我在GridLayout中使用GridView。但是它正在扩展到低于设备的高度。有什么特殊原因吗?我到处都搜索了类似的问题,但还没有找到任何东西。
这是axml的代码...我正在使用Xamarin。
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridLayout1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchMode="spacingWidthUniform"
android:gravity="center"
android:rowCount="6"
android:columnCount="2">
<GridView
android:id="@+id/gridView"
android:numColumns="auto_fit"
android:gravity="center"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_columnSpan="2"
android:layout_row="4"
android:layout_column="0" />
像这样使用“ android:layout_below”:
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridLayout1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchMode="spacingWidthUniform"
android:gravity="center"
android:rowCount="6"
android:columnCount="2"
android:layout_below="@id/headerRelativeLayout">
<GridView
android:id="@+id/gridView"
android:numColumns="auto_fit"
android:gravity="center"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_columnSpan="2"
android:layout_row="4"
android:layout_column="0" />
</GridLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句