<LinearLayout android:id="@+id/lnLayoutBottom" xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" /> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" android:enabled="false"/> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" /> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" android:enabled="false"/> <Button android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" android:layout_weight="1" android:enabled="false"/> </LinearLayout>

如果 五个Button的android:layout_width 属性 设置为 "fill_parent" 则 在android:layout_weight 的影响下, 起五个button的长度将相等,

如果设置为 wrap_content , 则其长度不等。。。。。

更多相关文章

  1. Android(安卓)maxLines maxLength属性
  2. android main.xml分析。。一点点补充
  3. Android(安卓)EditText 限制文本框输入的长度和提示信息
  4. Android(安卓)textview 显示不全的问题
  5. Android(安卓)textview 显示不全的问题
  6. Android中的Margin和Padding及Android支持的长度单位
  7. Android(安卓)限制EditText只能输入数字、限制输入类型、限制输
  8. 如果Imageview与Linearlayout有叠加且可选资源长度不同,如何布局?
  9. android main.xml分析。。一点点补充

随机推荐

  1. Android 开发者的 Flutter(三) —— Flutte
  2. Android P 开发者预览版 · 操作指南
  3. Android(安卓)打开相册选择单张图片实现
  4. Android单元测试——初探
  5. ANDROID音频系统散记之五:如何绕开多媒体
  6. Android(安卓)Studio打包Signed APK 碰到
  7. Map读取键值对,Java遍历Map的两种实现方法
  8. android的call与Phone的实现分析
  9. 搭建Android开发平台(Android studio)
  10. Android布局优化之ViewStub(三)