我正在努力实现以下GUI:
对于红线下方的9个元素(线下的所有内容均应可滚动),我使用了按预期工作的gridview布局.但是实际上我不知道如何制作标题.
到目前为止,我的xml:
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background = "@drawable/t"
tools:context=".AppStarter" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
android:id="@+id/gridview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
android:layout_marginLeft="2sp"
android:layout_marginRight="5sp"
android:layout_marginTop="0sp" />
我的想法是在gridview上添加一个额外的linearLayout,但是这种方法没有提供预期的结果.任何想法如何实现此标头?
提前致谢!
解决方法:
您可以尝试自己的实现.经过多次尝试,我决定编写自己的代码!
标签:gridview,android
来源: https://codeday.me/bug/20191030/1964987.html