網絡佈局的列之間的垂直線我想提出一個原生的Android應用程序,我想畫兩列之間的垂直線在網格佈局,有沒有什麼辦法可以做到這一點? 在以下屏幕截圖中,您可以看到單元格之間和列之間的線條。基本上,我只是想用我自己的自定義風格來顯示網格。 This is the link to see the screenshots, apparently stack wont let me post a pic如何顯示在android系統
0
A
回答
1
添加verticalSpacing中可以添加保證金上述查看您的網格佈局並將GridView背景設置爲您想要的線條的顏色。
<GridView
android:id="@+id/grid_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#DADADA"
android:verticalSpacing="1dp"
android:numColumns="2" />
1
0
如果您使用兩個LinearLayouts並排你可以使用框架分隔功能與易用性:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:divider="?android:listDivider"
android:dividerPadding="2.5dp"
android:orientation="horizontal"
android:showDividers="middle"
android:weightSum="2" > ... </LinearLayout>
參見:http://developer.android.com/reference/android/widget/LinearLayout.html
相關問題
- 1. 顯示在android系統
- 2. 顯示在android系統
- 3. 顯示在android系統
- 4. 顯示在android系統
- 5. Android系統如何使文本顯示
- 6. 如何顯示TextView的android系統
- 7. 錯誤:顯示java.lang.NullPointerException在android系統
- 8. 錯誤時顯示在android系統
- 9. 顯示圖像SD android系統
- 10. 如何viewflipper在android系統
- 11. 如何NestedScrollView在android系統
- 12. 我如何在android系統
- 13. 如何在android系統
- 14. 我如何顯示Android系統狀態欄中的文本
- 15. Android系統如何顯示空白的GridView與按鈕
- 16. 如何顯示圓圈動畫上點擊android系統
- 17. 在android系統
- 18. 在android系統
- 19. 在android系統
- 20. 在android系統
- 21. 在android系統
- 22. 在android系統
- 23. 在android系統
- 24. 在android系統
- 25. 在android系統
- 26. 在android系統
- 27. 在android系統
- 28. 在android系統
- 29. 在android系統
- 30. 在android系統
檢查[這個答案](HTTP:// stackoverflow.com/a/23891978/2826147) –
去下面的鏈接,你可能會發現你的解決方案http://stackoverflow.com/questions/12109126/android-gridview-row-dividers-separators –
很多很好的解決方案。你認爲如果我們去了1px ppl而不是1dp,你覺得如何?該產品線在高規格設備上看起來不錯而且更薄。這是否工作? – hasan83