android 布局-- 九宫格的实现首先是 的布局方式如下: 1. <?xml version="" encoding="utf-8"?> 2. <!-- 主界面的布局--> 3. <RelativeLayout 4. xmlns:android="http://schemas./apk/res/android" 5. android:orientation="vertical" 6. android:layout_width="fill_parent" 7. android:layout_height="fill_parent" 8. 9. >10. <RelativeLayout 11. android:id="@+id/MainActivityrlTwo" 12. android:layout_width="fill_parent" 13. android:layout_height="45dp" 14. 15. >16. 17. </RelativeLayout> 18. 19. <GridView 20. android:id="@+id/MainActivityGrid" 21. android:layout_width="fill_parent" 22. android:layout_height="wrap_content" 23. android:numColumns="3" 24. android:columnWidth="50dp" 25. android:layout_below="@+id/MainActivityrlTwo" 26. android:layout_marginTop="5dp" 27. /> 28. 29. <RelativeLayout 30. android:id="@+id/MainActivityrlThree" 31. android:layout_width="fill_parent" 32. android:layout_height="60dp" 33. android:layout_alignParentBottom="true" 34. 35. >36. <TextView 37. android:id="@+id/tvLineBottom" 38. android:layout_width="fill_parent" 39. android:layout_height="wrap_content" 40. android:text="***@string/line_default" 41. /> 42. <Button 43. android:id="@+id/btmore_MainActivity" 44. android:layout_alignParentRight="true" 45. android:layout_alignParentBottom="true" 46. android:layout_width="wrap_content" 47. android:layout_height="wrap_content" 48. android:text="More" 49. 50. /> 51. </RelativeLayout> 52. 53. </R
Android布局--九宫格示例 来自淘豆网m.daumloan.com转载请标明出处.