在开发过程中,发现了有时候即便是android:layout_width和android:layout_height都设置成了fill_parent,如下面示例中的paraTableLayout仍然没有全屏显示
<HorizontalScrollView android:layout_gravity="top" android:id="@id/horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" >
<TableLayout android:id="@id/paraTableLayout" android:background="#ff399999" android:layout_width="fill_parent" android:layout_height="fill_parent" />
</HorizontalScrollView>
解决办法是在HorizontalScrollView中添加android:fillViewport="true"即可
转自:http://blog.youkuaiyun.com/bluebluesea/article/details/8331346
本文介绍了一种解决HorizontalScrollView及其内部TableLayout组件未能全屏显示的问题。通过设置HorizontalScrollView的属性android:fillViewport为true,可以确保其内部布局能够正确地填充整个屏幕空间。

被折叠的 条评论
为什么被折叠?



