2013年3月29日

android layout 按比例布局的代码【转】

摘要: 为了创建比例大小的子View,可以将LinearLayout的宽度和高度设为fill_parent, 而将子View的宽度或是高度设为0,然后为子View设置不同权重(weight) ,这样子View的大小就会权值成比例。本例使用横向LinearLayout,LinearLayout的android:layout_width=”match_parent”,表示将使用整个屏幕宽度。对于LinearLayout的几个子View,将它们的宽度都定义为0,android:layout_width=”0dip”,然后使用layout_weight 为每个View指定宽度比例,本例为每个TextView都 阅读全文

posted @ 2013-03-29 10:29 liyingming 阅读(179) 评论(0) 推荐(0) 编辑

导航