Android突击:PanelLayout的实现
2015-07-11 00:42
561 查看
相对布局和线性布局的结合的例子
![](http://images0.cnblogs.com/blog/782258/201507/110042005187024.jpg)
[/code]
来自为知笔记(Wiz)
![](http://images0.cnblogs.com/blog/782258/201507/110042005187024.jpg)
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!-- 顶部 -->
<RelativeLayout
android:id="@+id/relativelayout_top"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:background="#FF0000"
android:gravity="center" >
<TextView
android:id="@+id/view_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="顶部标题"
android:textColor="#FFFF00" />
</RelativeLayout>
<!-- 底部 -->
<RelativeLayout
android:id="@+id/relativelayout_bottom"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="#00FFFF"
android:layout_alignParentBottom="true"
android:gravity="center" >
<TextView
android:id="@+id/view_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="底部标题"
android:textColor="#0000FF" />
</RelativeLayout>
<!-- 中部 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/relativelayout_bottom"
android:layout_below="@+id/relativelayout_top"
android:orientation="horizontal" >
<!-- 中部左侧栏 -->
<RelativeLayout
android:id="@+id/relativelayout_middleleft"
android:layout_width="200dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:background="#FF00FF"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/view_middleleft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="左侧标题"
android:textColor="#FFFFFF" />
</RelativeLayout>
<!-- 中部主框架 -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_toRightOf="@id/relativelayout_middleleft"
android:background="#eeccee"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="右侧标题"
android:textColor="#000066" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
[/code]
来自为知笔记(Wiz)
相关文章推荐
- APIDemo动画合集
- 蛇形抖动
- [Androd--Compile]友善Android源代码Ubuntu下编译环境配置
- [Android--Code]代码结构
- [Android--Tool]NDK下载与安装
- [Android--Code]Intent的学习与使用
- Android突击:实现屏幕四角和居中摆放控件的布局
- [Android--Tool]关于AVD的使用建议
- [Android--Tool]使用activity-lifecycle源码建立工程无R.java的问题
- [Android--Tool]Android如何将他人的代码放入新建的工程中
- [Android--Tool]不在Android设备运行而打开AVD问题解决
- [Android--Tool]Android的SDK文档的下载
- [Android--Tool]更新SDK后ADT版本低不支持问题的解决
- [Android--Tool]javadoc的生成
- [Android--Tool]SDK中截取连接的被调试手机的画面
- [Android--Tool]提示adb is down问题与解决
- [Android--Tool]Android开发环境安装与配置
- [Android--NDK]android_serialport_api学习
- [Android--Tool]开发环境(ADT)安装与配置
- Android突击:FrameLayout制作霓虹灯效果