我想以水平方式在GridLayout(3列)中添加视图,但未指定子视图宽度,有时它具有非常宽的宽度。因为它的第三个元素超出了视野宽度。以编程方式在布局中添加子视图
我想知道是否有任何布局或任何方式来完成它。
三江源
<GridLayout
android:id="@+id/activity_detailed_view_gl_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="3"
android:layout_gravity="start|top"
android:orientation="horizontal"
android:layout_marginBottom="10dp" />
您是否尝试在您的gridview中添加'android:numColumns =“3”'&'android:layout_width =“match_parent”'?你能发布xml文件的代码吗?那会更好.. – eshb
请提供一些你已经使用的代码。 –
@baymaxx看到我的xml代码(这是GridLayout不是GridView)。 –