安卓layout布局三等分
来源:互联网 发布:企业信息化软件有哪些 编辑:程序博客网 时间:2024/06/06 03:27
关于android LinearLayout的比例布局,主要有以下三个属性需要设置:
1,android:layout_width,android:layout_height,android:layout_weight三个值
2,当为水平布局时,android:layout_height=“0dp",当为垂直布局时,android:layout_width="0dp",android:layout_weight为所占比重。
以水平布局为例:
<LinearLayout android:layout_width="fill_parent" android:layout_height="50dp" android:gravity="center" android:background="@color/white"> <LinearLayout android:layout_width="0dp" android:layout_weight="1" android:gravity="center" android:layout_height="wrap_content"> <TextView android:id="@+id/up_grade" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/black" android:text="模块一"/> </LinearLayout> <View android:layout_width="1px" android:layout_height="fill_parent" android:background="@color/border_clo"/> <LinearLayout android:layout_width="0dp" android:layout_weight="1" android:gravity="center" android:layout_height="wrap_content"> <TextView android:id="@+id/integral_mall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/black" android:text="模块二"/> </LinearLayout> <View android:layout_width="1px" android:layout_height="fill_parent" android:background="@color/border_clo"/> <LinearLayout android:layout_width="0dp" android:layout_weight="1" android:gravity="center" android:layout_height="wrap_content"> <TextView android:id="@+id/data_analysis" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/black" android:text="模块三"/> </LinearLayout></LinearLayout>
0 0
- 安卓layout布局三等分
- 安卓开发--Layout--布局---SDK(一)
- 安卓开发--Layout--布局---SDK(二)
- Android Percent Layout 安卓百分比布局
- 安卓开发 Dachshund-Tab-Layout选项卡布局
- box-flex实现三等分布局
- 三等分
- 安卓layout分包
- 用Eclipse开发安卓-无法正常预览布局文件layout.xml
- 安卓的几种布局管理器(Layout)各有什么特点
- 安卓动画系列————layout(布局)动画
- Auto Layout 使用心得(二)—— 实现三等分
- Auto Layout 使用心得—— 实现三等分
- 安卓无法显示layout
- 安卓layout属性大全
- 安卓布局--线性布局
- layout布局
- 布局layout
- Android学习之文件断点下载
- java歌德巴赫猜想的证明
- ids for this class must be manually assigned before calling save(): org.lee.model.UserHibernate
- Autofac在ASP.NET MVC中的使用
- Android实战之app版本更新升级全文章(二)
- 安卓layout布局三等分
- ArcGis发布图层
- 在centos中安装jdk
- jvm 策略与保护域,自定义类加载器
- f12只显示当前的静态页面,如果再执行任何前台操作(不与服务器进行交互),静态页面的代码是不会发生任何改变的
- delphi出现‘尚未调用CoInitialize’异常
- Java设计模式——单列模式
- Spark学习——始
- 创建多线程Extend,Runnable,Callable