android 布局 上中下,android常用布局样式上、中、下三层

本文介绍了如何在Android中实现常见的网页布局结构——页头、内容区域和页尾。通过XML布局文件展示了具体的代码实现,包括设置`match_parent`和`wrap_content`属性来调整组件大小,以及使用`alignParentTop`和`alignParentBottom`属性进行位置定位。示例中,页头包含居中显示的文本,内容区域用于展示列表,而页尾则展示了底部的文本视图。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我们在常用开发中经常用到一种布局结构,就是类似网页的页头、中间内容、页尾,下面我们就来看看在android中是怎样布局的。

1c4ae98f84c09c142e35e8c36637c153.png

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_alignParentTop="true" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center"

android:text="111111" />

android:id="@android :id/list"

android:layout_width="match_parent"

android:layout_height="wrap_content" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_alignParentBottom="true" >

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:gravity="center"

android:text="222222" />

我的博客其它文章列表

http://my.oschina.net/helu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值