一、关于给控件添加ID属性

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<include
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
layout="@layout/top" />
<Button
android:id="@+id/wifi_test_bnt"
style="@style/CommonButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/top"
android:text="@string/wifi_setting" />
<!-- WIFI测试项的提示 -->
<TextView
android:id="@+id/tv_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_below="@+id/wifi_test_bnt"
android:text="@string/global_test_str"
android:visibility="gone" />
<ListView
android:id="@+id/wifi_listview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/bottom"
android:layout_below="@id/wifi_test_bnt"
android:text="@string/hello" >
</ListView>
<include
android:id="@+id/bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
layout="@layout/bottom" />
</RelativeLayout>

如上所述,实际布局效果如下:

实际上为底部布局添加ID属性,是在定义其之前的位置。也即是说,在定义ListView时,为底部布局添加了ID属性。

其一使用了 android:layout_above="@+id/bottom";其二使用了 android:id="@id/bottom"

Android常规布局方式和方法的更多相关文章

  1. 【深入篇】Android常用布局方式简介

    LinearLayout 线性布局是程序中最常见的布局方式.一般分为水平线性布局和竖直线性布局,通过android.orientation属性可以设置线性布局的方向. 在布局中操作颜色时,要用的是十六 ...

  2. Android的布局方式

    1.LinearLayout(线性布局) android:orientation="vertical" //布局 android:layout_width="wrap_c ...

  3. Android常规布局(网络异常布局、空数据布局,未登录布局等)切换工具类,Layout切换

    本人已整理好发布到github,已优化. github地址:https://github.com/buhuiming/StatusLayoutManager 使用:compile 'com.bhm.s ...

  4. android layout布局属性

    参考:http://blog.csdn.net/msmile_my/article/details/9018775 第一类:属性值 true或者 false           android:lay ...

  5. Android layout 布局 属性详解

    第一类:属性值 true或者 false           android:layout_centerHrizontal 水平居中     android:layout_centerVertical ...

  6. Android开发之基本控件和详解四种布局方式

    Android中的控件的使用方式和iOS中控件的使用方式基本相同,都是事件驱动.给控件添加事件也有接口回调和委托代理的方式.今天这篇博客就总结一下Android中常用的基本控件以及布局方式.说到布局方 ...

  7. Android入门(十):界面的布局方式及其实际应用

    关于Android界面布局,网上已经有了很多非常不错的学习资料,在这里我也不班门弄斧了,推荐两篇我认为写的不错的教程,然后再重点讲一下几种布局方式的实际应用. 教程链接:①http://www.cnb ...

  8. 【Android UI】Android开发之View的几种布局方式及实践

    引言 通过前面两篇: Android 开发之旅:又见Hello World! Android 开发之旅:深入分析布局文件&又是“Hello World!” 我们对Android应用程序运行原理 ...

  9. Android 开发之旅:view的几种布局方式及实践

    本文的主要内容就是分别介绍以上视图的七种布局显示方式效果及实现,大纲如下: 1.View布局概述 2.线性布局(Linear Layout) 2.1.Tips:android:layout_weigh ...

随机推荐

  1. CentOS 7 yum 安装php5.6

    注意--enablerepo=remi --enablerepo=remi-php56这两个参数,指定源的意思 配置yum源 追加CentOS 6.5的epel及remi源. # rpm -Uvh h ...

  2. golang range遍历是新创建对象还是创建对象的引用

    golang range遍历是新创建对象还是创建对象的引用,通俗的讲就是range对range出来的对象的修改会不会同步到被遍历的那个数组.先看如下代码: package main import ( ...

  3. BZOJ4314 倍数?倍数!

    好神仙啊.... 题意 在$ [0,n) $中选$ k$个不同的数使和为$ n$的倍数 求方案数 $ n \leq 10^9, \ k \leq 10^3$ 题解 k可以放大到1e6的 先不考虑$ k ...

  4. 搜索表字段包含某字符串的SQL和监控Oracle数据库的SQL。

    1.第一个SQL 背景:需要找到SQL Server数据库中,包含某个字符串的表,输出表和包含该字符串的列. )='=' --这里填要搜索的字符串 DECLARE @sql NVARCHAR(MAX) ...

  5. CentOS7.6搭建redis4.0.1 cluster集群

    1. 操作系统信息: $ uname -a Linux iZbp11d57wmumnwuihb2czZ -.el7.x86_64 # SMP Fri Feb :: UTC x86_64 x86_64 ...

  6. python实现压缩当前文件夹下的所有文件

    import os import zipfile def zipDir(dirpath, outFullName): ''' 压缩指定文件夹 :param dirpath: 目标文件夹路径 :para ...

  7. 工具篇之GIT知识整理(一)

    目录 项目工具篇(一)GIT 说在前面 背景 与其他版本控制产品对比 Git下载地址及安装 下载地址 安装 在案例中简单使用Git命令 git clone git log git diff git c ...

  8. Luogu 3371【模板】单源最短路径

    Luogu 3371[模板]单源最短路径 第一次写博客用图论题来试一试 接下来是正文部分 题目描述 如题,给出一个有向图,请输出从某一点出发到所有点的最短路径长度. 输入输出格式 输入格式: 第一行包 ...

  9. R语言数据类型

    R语言数据类型[转!!]Zhao-Pace  https://www.cnblogs.com/zhao441354231/p/5970544.html   R语言用来存储数据的对象包括: 向量, 因子 ...

  10. 十 LVS 负载均衡

    回顾nginx 反向代理负载均衡 负载均衡的妙用 负载均衡(Load Balance)集群提供了一种廉价.有效.透明的方法, 来扩展网络设备和服务器的负载.带宽.增加吞吐量.加强网络数据处理能力. 提 ...