0
A
回答
0
创建自定义适配器然后根据你的设计膨胀的观点,下面的链接可能会更有帮助https://guides.codepath.com/android/Heterogenous-Layouts-inside-RecyclerView
0
0
试试这个代码片段:
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alignmentMode="alignBounds"
android:columnCount="2"
android:columnOrderPreserved="false"
android:useDefaultMargins="true"
>
<Button
android:layout_rowSpan="2"
android:layout_column="0"
android:layout_columnWeight="0.5"
android:layout_gravity="fill"
android:layout_row="0"
android:text="Button 1" />
<Button
android:layout_gravity="fill"
android:layout_column="1"
android:layout_columnWeight="0.5"
android:layout_row="0"
android:text="Button 2" />
<Button
android:layout_gravity="fill"
android:layout_column="1"
android:layout_row="1"
android:text="Button 3" />
<Button
android:layout_gravity="fill"
android:layout_column="0"
android:layout_row="2"
android:text="Button 4" />
<Button
android:layout_gravity="fill"
android:layout_column="0"
android:layout_row="3"
android:text="Button 5" />
<Button
android:layout_gravity="fill"
android:layout_column="1"
android:layout_row="2"
android:layout_rowSpan="2"
android:text="Button 6" />
<Button
android:layout_gravity="fill"
android:layout_column="0"
android:layout_row="4"
android:layout_rowSpan="2"
android:text="Button 7" />
<Button
android:layout_gravity="fill"
android:layout_column="1"
android:layout_row="4"
android:text="Button 8" />
<Button
android:layout_gravity="fill"
android:layout_column="1"
android:layout_row="5"
android:text="Button 9" />
</GridLayout>
相关问题
- 1. 如何更改列表视图中项目的最大高度
- 2. ListView项目高度
- 3. 设置项目的高度等于项目
- 4. 更改列表查看项目高度
- 5. 25%高度的列表视图项目
- 6. 列表视图动态项目高度
- 7. 更改第一项dropdownlist
- 8. 基于屏幕高度改变UIStackView项目的高度
- 9. Android的ListView项目更改高度项目
- 10. ItemsControl中的项目占用第一项的宽度
- 11. 如何使用CustomTreeCtrl和TR_HAS_VARIABLE_ROW_HEIGHT样式来更改项目高度?
- 12. 更改列表视图项的高度和颜色? (android)
- 13. Android网格查看项目纵横比(使高度稍高于宽度)
- 14. SWT树项目高度
- 15. 依赖于第一个选择选项更改第二个选择选项
- 16. 在第一项
- 17. 插入新项目的ListView第一项
- 18. 第一项dropdownlist项目不可选asp.net
- 19. 高度不适用于li项目
- 20. 高效识别第一组中的任何项目是否与第二组中的任何项目匹配
- 21. 无法更改高分子纸项目的高度
- 22. 如何动画ListView项目高度?
- 23. 如何动画ListView项目的高度
- 24. Django的第一个项目
- 25. android:listview专注于第一项
- 26. 如何发布依赖于第三方SNAPSHOT项目的项目
- 27. 猫头鹰传送带高度被设置为最大的项目第一个
- 28. 设置一个高度上的项目
- 29. 如何将3个第一代MVC项目合并到一个项目中?
- 30. 使网格项中的内容等于CSS中的高度网格
使用交错网格视图。 – Ankita