Use a layout_width of 0dip instead of wrap_content for better performance.......【Written By KillerLegend】

当你在一个Linearlayout布局中只为一个组件设置android:layout_weight属性时,那么这个组件将默认填充Linearlayout的剩余空间(宽度与高度方向),而不用事先进行测量。此时如果你对该组件的android:layout_width="wrap_content"时就会出现此警告:

Use a layout_width of 0dip instead of wrap_content for better performance.......

这是候,你要么把这个layout_weight属性去掉,要么将wrap_content的值设置为零,设置为零的含义就是,系统将默认填充Linearlayout的剩余空间(宽度与高度方向)。

posted @ 2013-10-01 00:09  KillerLegend  Views(632)  Comments(0Edit  收藏  举报