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