Android应用程序使用两个LinearLayout编排5个Button控件
2017-11-28 23:14
232 查看
学习存档:
效果如下:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:text ="按钮一" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="left"/> <Button android:text="按钮二" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center"/> <Button android:text="按钮三" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right"/> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:text="按钮四" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.25"/> <Button android:text="按钮五" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.75"/> </LinearLayout> </LinearLayout>
效果如下:
相关文章推荐
- Android中LinearLayout、RelativeLayout、TableLayout、AbsoluteLayout容器的使用
- [转载]对android LinearLayout中layout_weight属性使用初探
- Android LinearLayout使用selector改变交互时背景颜色
- android linearLayout 和 RelativeLayout使用的注意事项
- Android使用DrawerLayout创建左右两个抽屉菜单
- Android使用DrawerLayout创建左右两个抽屉菜单 推荐
- android LinearLayout布局中layout_weight的使用(二)
- 自定义的LinearLayout 使用报错 android.view.InflateException: Binary XML file line #3: Error inflating class
- Android 使用线性布局LinearLayout和Button实现一个点红块游戏
- Android使用DrawerLayout创建左右两个抽屉菜单
- Android中LinearLayout框架使用案例26Days TO_1
- Android UI LinearLayout权限级别与TableLayout混合使用,
- 【黑马Android】(04)数据库的创建和sql语句增删改查/LinearLayout展示列表数据/ListView的使用和BaseAdater/内容提供者创建
- ScrollView中的LinearLayout不能使用android:layout_heig...
- android之线性布局LinearLayout以及weight权重使用
- Android Layout布局使用总结Android中常用的5大布局方式有以下几种: 线性布局(LinearLayout):按照垂直或者水平方向布局的组件。 帧布局(FrameLayout):组件从
- Android布局之LinearLayout与TableLayout的嵌套使用
- Android在java代码中使用layout_gravity和gravity这两个属性
- Android中LinearLayout、RelativeLayout、TableLayout、AbsoluteLayout容器的使用
- Android LinearLayout布局嵌套及权重weight的使用