回答
上進行@紋理貼圖/ ic_launcher_round
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="4sp"
android:orientation="horizontal"
android:weightSum="4">
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4sp"
android:layout_weight="1"
android:src="@mipmap/ic_launcher_round" />
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4sp"
android:layout_weight="1"
android:src="@mipmap/ic_launcher_round" />
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4sp"
android:layout_weight="1"
android:src="@mipmap/ic_launcher_round" />
<ImageButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="4sp"
android:layout_weight="1"
android:src="@mipmap/ic_launcher_round" />
</LinearLayout>
</LinearLayout>
您是否嘗試過表佈局中做這樣的事情?雖然您可以使用任何佈局,但我建議您堅持一個父佈局,如相對佈局,然後再使用多個子佈局來管理UI元素。
我建議不要使用「兒童佈局」,因爲嵌套佈局不利於演出。 –
是的。但有時候,當你不想使用約束佈局時,你必須使用這種方法。 – Abhinash
或者您可以使用GridView,就像我之前評論中所建議的那樣。 –
感謝大家解決方案的設置您繪製的圖像。我張貼的圖像是在Photoshop上編輯的。 Now i did it in android studio using linear layout
- 1. Android:在RelativeLayout上放置4個按鈕
- 2. 如何創建一個新表單並在其上放置一個按鈕?
- 3. 如何創建一個面板上的拖放在flex 4?
- 4. 如何創建一個方形按鈕?
- 5. 如何在圖像上放置按鈕
- 6. 如何在圖像上放置按鈕
- 7. 如何在頁面上放置一個類似按鈕?
- 8. Android如何創建方形FAB按鈕?
- 9. 如何將兩個按鈕放在Android中的同一行上
- 10. 將按鈕放置在Android上的複雜形狀上
- 11. 在RelativeLayout上放置一個按鈕
- 12. 在畫布上放置一個按鈕
- 13. 如何在我的頁面上添加按鈕(在HTML上放置按鈕)
- 14. 如何在iPhone上的地圖上放一個按鈕
- 15. 如何在android中創建一個帶有圓形的方形框架按鈕?
- 16. 如何繪製一個圓形按鈕並在其上打上標籤
- 17. 如何在圖形視圖android上創建靜態標籤?
- 18. Android - 試圖在一個圓形界面中按區域創建按鈕
- 19. android-想把按鈕放在listview上面
- 20. 如何在Titanium中的按鈕上放置圖像和標籤?
- 21. 如何檢測何時按下按鈕並在android上釋放
- 22. 如何在按鈕上創建制表符和設置頁面?
- 23. 如何將兩個按鈕居中放在一個頁面上
- 24. 如何在桌面上放置兩個按鈕
- 25. 創建多個面板並在按鈕上單擊顯示一個面板wpf
- 26. Android:在繪製線上放置按鈕
- 27. 在視頻標籤上放置按鈕
- 28. 如何在Android上創建50hz方波並播放它
- 29. android創建一個按鈕,它上面有一些東西
- 30. 如何在圖形的整行上設置一個標籤
沒有最好的辦法。你試過什麼了?究竟是什麼問題?使按鈕成方形?把它們放在一排?在他們上面放置圖標? –
我的2分錢投入:一個GridView與一行ImageButtons。 –
你可以使用Weight來平均分配其中的4個行。你可以發佈你的Code.What你有做到目前爲止?? – seon