Android常规布局方式和方法
一、关于给控件添加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常规布局方式和方法的更多相关文章
- 【深入篇】Android常用布局方式简介
		LinearLayout 线性布局是程序中最常见的布局方式.一般分为水平线性布局和竖直线性布局,通过android.orientation属性可以设置线性布局的方向. 在布局中操作颜色时,要用的是十六 ... 
- Android的布局方式
		1.LinearLayout(线性布局) android:orientation="vertical" //布局 android:layout_width="wrap_c ... 
- Android常规布局(网络异常布局、空数据布局,未登录布局等)切换工具类,Layout切换
		本人已整理好发布到github,已优化. github地址:https://github.com/buhuiming/StatusLayoutManager 使用:compile 'com.bhm.s ... 
- android layout布局属性
		参考:http://blog.csdn.net/msmile_my/article/details/9018775 第一类:属性值 true或者 false android:lay ... 
- Android layout 布局 属性详解
		第一类:属性值 true或者 false android:layout_centerHrizontal 水平居中 android:layout_centerVertical ... 
- Android开发之基本控件和详解四种布局方式
		Android中的控件的使用方式和iOS中控件的使用方式基本相同,都是事件驱动.给控件添加事件也有接口回调和委托代理的方式.今天这篇博客就总结一下Android中常用的基本控件以及布局方式.说到布局方 ... 
- Android入门(十):界面的布局方式及其实际应用
		关于Android界面布局,网上已经有了很多非常不错的学习资料,在这里我也不班门弄斧了,推荐两篇我认为写的不错的教程,然后再重点讲一下几种布局方式的实际应用. 教程链接:①http://www.cnb ... 
- 【Android UI】Android开发之View的几种布局方式及实践
		引言 通过前面两篇: Android 开发之旅:又见Hello World! Android 开发之旅:深入分析布局文件&又是“Hello World!” 我们对Android应用程序运行原理 ... 
- Android 开发之旅:view的几种布局方式及实践
		本文的主要内容就是分别介绍以上视图的七种布局显示方式效果及实现,大纲如下: 1.View布局概述 2.线性布局(Linear Layout) 2.1.Tips:android:layout_weigh ... 
随机推荐
- hibernate自定义校验Valid
			步骤: 1.定义注解: import javax.validation.Constraint; import javax.validation.Payload; import java.lang.an ... 
- STM32库函数void USART_SendData的缺陷和解决方法
			void USART_SendData()函数在快速发送时存在问题 有丢数据的可能 转自https://blog.csdn.net/qq_27114397/article/details/506015 ... 
- 堆,set,优先队列
			当我们需要高效的完成以下操作时: 1.插入一个元素 2.取得最小(最大)的数值,并且删除 能够完成这种操作的数据结构叫做优先队列 而能够使用二叉树,完成这种操作的数据结构叫做堆(二叉堆) 堆与优先队列 ... 
- 主成分分析算法(PCA)
			通过数据压缩(降维)可以减少特征数量,可以降低硬盘和内存的存储,加快算法的训练. 还可以把高维的数据压缩成二维或三维,这样方便做数据可视化. 数据压缩是通过相似或者相关度很高的特征来生成新的特征,减少 ... 
- 机器学习基石8-Noise and Error
			注: 文章中所有的图片均来自台湾大学林轩田<机器学习基石>课程. 笔记原作者:红色石头 微信公众号:AI有道 上一节课,我们主要介绍了VC Dimension的概念.如果Hypothese ... 
- 【easy】108. Convert Sorted Array to Binary Search Tree
			Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Fo ... 
- goroute应用-模拟远程调用RPC
			go语言简单模拟RPC,详见个人新博客:blog.dlgde.cn 代码如下: package main import ( "errors" "fmt" &qu ... 
- Django --- 单表的增删改查
- Oracle 数据库监听无法连接上、监听HANG住、监听无响应、TNS-12560
			环境: Windows server 2003 Oracle 11.2.0.1 问题: 一套老数据库在运行了很久后,突然就连接不上了,提示监听异常. 处理: 1.CMD命令行检查监听状态:无监听 2. ... 
- MAC本apache+php配置虚拟域名时踩的坑
			昨天在调试Mac自带的Apache+PHP配置域名时,调试的让我怀疑人生.顿时心里一万个草泥马,我就是配置个虚拟域名啊,这么让我受伤 . 1 首先检查一下Apache是否开启, qutao@bogon ... 
