在做android界面设计时如果使用到TableLayout布局即表格布局,要想让界面中的控件填满整个屏幕除了要设置TableLayout的属性
android:layout_width="fill_parent"    android:layout_height="fill_parent"
还需要设置TableRow的属性为
android:layout_width="fill_parent"        android:layout_height="fill_parent"         android:layout_weight="1"
注意这里的android:layout_weight="1"一定不能忘了,否则子控件的android:layout_height="fill_parent"是不起作用的。
最后就是界面控件的属性了,这里以Button为例来做演示
和上面的一样这里的android:layout_weight="1"也不能少,这个保证按钮能在横向上铺满屏幕。
完整的布局文件代码如下:
            
效果如下:

更多相关文章

  1. Android图表控件MPAndroidChart——曲线图LineChart(多条曲线)动态
  2. 关于声明文件中android:process属性说明
  3. View组件之各xml属性
  4. android 最全的shape属性
  5. android:cacheColorHint,android:listSelector属性作用
  6. TextView的drawable属性
  7. android流式布局热门标签的实现

随机推荐

  1. influxDB安装部署及入门
  2. Oracle如何使用spool导出utf8字符集的文
  3. memcache中的过期时间策略
  4. Linux 下使用 killall 命令终止进程
  5. Oracle 18c - 配置只读 OracleHome / DBC
  6. MySQL 续集 02
  7. 技术问答-20 ArrayList和LinkedList
  8. Oracle DB 18c - 手动升级到 18c 的完整
  9. 技术问答-21 线程 进程
  10. nginx配置实例解释