android中一些简单的布局
2015-06-02 16:17
483 查看
布局码如下
<?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:shrinkColumns="0,1,2,3"> <TableRow> <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭1" android:layout_column="0" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭2" android:layout_column="1" /> </TableRow> <TableRow> <Button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭3" android:layout_column="1" /> <Button android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭4" android:layout_column="2" /> </TableRow> <TableRow> <Button android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭5" android:layout_column="2" /> </TableRow> <TableRow > <Button android:id="@+id/button6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="按扭6" android:layout_column="3" /></TableRow> </TableLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/button1"
android:layout_weight="1"
android:id="@+id/button"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1" >
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/button2" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/button3" />
</LinearLayout>
</LinearLayout>
相关文章推荐
- 去除Android系统应用的通知功能
- 【Rayeager PX2分享】最简单helloworld驱动编写
- Android与IOS的后台与推送对比
- Android系统介绍
- android 中文 api (64) —— Scroller
- Android r文件丢失的解决办法
- android SharedPreferences设置初始密码,并修改密码
- JAVA ANDROID SOCKET通信检测(SERVER)连接是否断开
- android获取屏幕宽高与获取控件宽高
- android中的ellipsize
- Android EditText 的属性
- android中TextView分段显示不同颜色,字体,时间
- android获取当前经纬度,并用地图显示跟踪
- android的入门学习
- [Android] ListView中getView的原理+如何在ListView中放置多个item
- Android初学者冷知识
- android Button美化
- Android 集成支付宝SDK实现快捷支付--详解
- android 中可展开控件ExpandableListView的使用
- AndroidManifest.xml详解