一、关于给控件添加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. 在Ubuntu下进行XMR Monero(门罗币)挖矿的超详细图文教程

    大家都知道,最近挖矿什么的非常流行,于是我也在网上看了一些大神写的教程,以及跟一些大神请教过如何挖矿,但是网上的教程都感觉写得不够详细,于是今天我这里整理一个教程,希望能够帮到想要挖矿的朋友. 首先, ...

  2. data_summarize.pl data目录文本时长汇总脚本

    #!/usr/bin/env perl # Copyright 2018 Jarvan Wang if (@ARGV != 1) { #print STDERR "Usage: keywor ...

  3. 【汇编语言】DOXBox 0.74 常用debug命令

    1.查看.修改寄存器(r命令) ①-r ②-r  ax(要修改的寄存器) -:m(输入想要改成什么值) 2.查看内存单元(d命令) ①-d 查看128个内存单元内容. ②-d 段地址:偏移地址 查看指 ...

  4. 解决:在微信中访问app下载链接提示“已停止访问该网页”

    前言 现如今微信对第三方推广链接的审核是越来越严格了,域名在微信中分享转发经常会被拦截,一旦被拦截用户就只能复制链接手动打开浏览器粘贴才能访问,要不然就是换个域名再推,周而复始.无论是哪一种情况都会面 ...

  5. 阿里云服务器ftp连接后21端口无法使用的问题

    今天在阿里云Centos上搭了一个ftp 服务,开启了20和21端口的权限.但是用工具和ftp命令登录,均超时. ftp命令登录成功后不能使用ls 命令,直接超时. 工具登录成功后 获取根目录失败,也 ...

  6. win10只有edge浏览器能上网的解决方法

    问题描述:电脑就只有edge浏览器和自带的邮件可以上网,但是QQ Chrome,360浏览器都无法上网: 解决方法:打开命令提示符(管理员),执行netsh winsock reset,重启系统就好了 ...

  7. Java基础12-工具类;变长参数;IO

    作业解析 取出整数的16进制表示形式 \u00ff /** * int2hex * */ public static String int2hex(int i) { String str = &quo ...

  8. linux常见故障处理

    目录 一. 文件和目录类 1.1 File exist 文件已经存在 1.2 No such file or directory 没有这个文件或目录(这个东西不存在) 1.3 command not ...

  9. Linux查看显示编辑文本文件

    1:cat -bash-4.1$ cat --help 用法:cat [选项]... [文件]... 将[文件]或标准输入组合输出到标准输出. -A, --show-all           等于- ...

  10. BeanUtils.copyProperties缓解代码压力,释放双手

    简单描述:之前在写代码的时候,经常把表单提交到后台的对象的参数,通过getter方法取出来,然后,再通过setter方法传递给需要的对象,代码中写了很多get set这种方法,后来听同事说,sprin ...