0
A
回答
0
最簡單的方法就是你設置的背景,活動,創造Buttons
,希望你沒事的那部分,
然後你就可以使用android:alpha=""
屬性中的每個按鈕,使之更加透明或不透明,它可以具有從0
到1.0
的值
0
您可以在XML文件中使用TableLayout來使它們全部對齊。使用weight屬性給他們的大小,選擇一個不透明的背景color.I用下面的代碼在一個相對佈局和它來八九不離十:
<TableLayout
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:gravity="center_horizontal">
<Button
android:text="Button" //Store this in your strings resource folder
android:background="#a6000000"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="150dp"//Store this in your dimens resource folder/>
<Button
android:text="Button"
android:layout_weight="1"
android:background="#a6000000"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginLeft="10dp"/>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_horizontal">
<Button
android:text="Button"
android:layout_weight="1"
android:background="#a6000000"
android:layout_width="wrap_content"
android:layout_height="150dp"/>
<Button
android:text="Button"
android:layout_weight="1"
android:background="#a6000000"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_marginLeft="10dp"/>
</TableRow>
</TableLayout>
0
,只要你想我上面已經創建的佈局。請參考下面的XML。 希望它有幫助!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:weightSum="5"
android:alpha="0.5"
android:background="@drawable/backround"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:alpha="0.5"
android:layout_width="match_parent"
android:layout_weight="3"
android:layout_height="0dp">
<!--Put your any content here-->
</LinearLayout>
<LinearLayout
android:alpha="0.5"
android:layout_weight="2"
android:weightSum="2"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="0dp">
<LinearLayout
android:layout_weight="1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp">
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_weight="1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp">
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
<Button
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
相關問題
- 1. Android應用程序:按下按鈕並打開新佈局
- 2. 遠程將按鈕添加到android應用程序佈局
- 3. 添加自定義佈局到android應用程序的按鈕
- 4. Android應用程序圖像按鈕的最佳佈局?
- 5. Android應用程序佈局
- 6. Android應用程序佈局
- 7. Android按鈕的佈局
- 8. 沒有佈局的Android應用程序
- 9. Android的youtube應用程序佈局?
- 10. Android應用程序的佈局問題
- 11. Android應用程序的簡單佈局
- 12. Android應用程序:佈局的問題
- 13. Android人的應用程序佈局
- 14. XML改變佈局按鈕崩潰的應用程序
- 15. Android Xml按鈕佈局
- 16. Android圖像按鈕佈局
- 17. Android佈局或按鈕
- 18. 佈局Android webview和按鈕
- 19. Android按鈕浮動佈局
- 20. 動態按鈕Android佈局
- 21. Android - 按鈕填充佈局
- 22. Android佈局複雜按鈕
- 23. 動態按鈕佈局android
- 24. Android按鈕樣式佈局
- 25. 使用按鈕的Android XML佈局
- 26. Android中的按下按鈕佈局
- 27. 我的Android應用程序佈局不顯示佈局
- 28. 如何設置計算器應用程序按鈕佈局
- 29. 應用程序內購買還原按鈕替代佈局
- 30. Android Pocket應用程序設計佈局