适配较好的写法
2015-07-01 17:06
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="1"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
<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="1"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
相关文章推荐
- 题目1008:最短路径问题
- iOS开发之iOS程序偏好设置(Settings Bundle)的使用
- BaiduMap---百度地图官方Demo之基本地图功能(创建一张百度地图并管理地图的生命周期)
- 操作远程计算机文件
- iOS开发笔记24--第三方库JSONModel的使用
- XGBoost:参数解释
- 从github上导入dubbo项目
- Rails应用开发点滴
- Entityframework codefirst 数据库变更
- MQTT的学习研究(六) MQTT moquette 的 Blocking API 订阅消息客户端使用
- 登录织梦后台成功后又返回登录页面
- 轻松突破GRE阅读难句在于掌握语法结构
- ios数据库应用高级编程
- 【实用】Excel表格技巧合集,让你工作效率翻一倍!
- struts.xml的加载路径及配置问题
- 给openwrt移植一个其他项目的问题记录
- IE7,8,9兼容性处理
- MQTT的学习研究(五) MQTT moquette 的 Blocking API 发布消息服务端使用
- wifi中的ap、sta、ap+sta模式的含义
- 第六节 MAKEFILE的常用命令