按比例分布控件
2015-07-01 17:02
232 查看
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.uilayouttest.MainActivity"
tools:ignore="MergeRootFrame" >
<EditText
android:id="@+id/editText1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
关键看宽度:0dp 必须如此 不小心包裹内容就看不出效果了
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.uilayouttest.MainActivity"
tools:ignore="MergeRootFrame" >
<EditText
android:id="@+id/editText1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
关键看宽度:0dp 必须如此 不小心包裹内容就看不出效果了
相关文章推荐
- Framework-res.apk内容简介
- linux swap详解
- A*寻路
- 如何编写有效测试用例
- 图片_ _图片缓存之内存缓存技术LruCache,软引用
- MQTT的学习研究(二)moquette-mqtt 的使用之mqtt broker的启动
- org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
- HDU 2444 The Accomodation of Students (偶图判定,匈牙利算法)
- C#中构造函数的作用
- jquery移动端常用总结
- linux服务管理---独立服务和基于xinetd服务的管理
- UI效果
- 使用Azure媒体服务对现场活动进行直播
- 安卓微信支付集成(1)--微信支付功能的申请
- Android Studio 右侧条标高亮显示选中的相同变量,类,方法。。。
- lvs、nginx、haproxy中转模式总结
- Java-Eclipse-Jabref一条龙
- 测试用例设计——场景分析法
- MQTT的学习研究(一)MQTT学习网站
- html5_zol