0
A
回答
0
如果你使用的RelativeLayout您可以將容器改變的LinearLayout和layout_weight設置爲它的孩子們:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Text 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="Text 2"/>
</LinearLayout>
0
讓我們考慮你的XML文件
創建內部RelativeLayout並將其寬度和高度設置爲match_parent
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<!-- here you create your RelativeLayout -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<EditText
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/reminder" />
<TextView
android:id="@+id/dates"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/times" />
<TextView
android:id="@id/times"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_alignParentRight="true" />
<Button
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_below="@id/times"
android:layout_centerInParent="true"
android:text="@string/done" />
<!-- here close of your created RelativeLayout -->
</RelativeLayout>
</RelativeLayout>
相關問題
- 1. 你如何讓窗戶填滿整個屏幕?
- 2. 如何讓ListView行填滿屏幕?
- 3. Android工具欄填滿整個屏幕
- 4. Gridview並沒有填滿整個屏幕
- 5. dplyr :: tbl_df填滿整個屏幕
- 6. Admob橫幅未填滿整個屏幕
- 7. RecyclerView項目填滿整個屏幕
- 8. fill_parent不填滿整個屏幕在LinearLayout
- 9. 如何讓td內容填滿整個家長?
- 10. 讓Textview文字填滿屏幕?
- 11. 如何讓最後一個div拉伸填滿屏幕?
- 12. 如何防止UILabel填滿整個屏幕?
- 13. 如何讓圖像填滿整個容器?
- 14. 在XUL中,如何讓我的列表框填滿屏幕?
- 15. GridLayout不填滿屏幕
- 16. Android:填充整個屏幕的內容低於
- 17. 製作一個div填滿屏幕
- 18. 的OpenGL - 使用glTexImage2d填滿整個屏幕,質感
- 19. 自定義headview不填滿整個屏幕
- 20. ProgressBar(微調)正在填滿整個屏幕
- 21. Android TableLayout高度不會填滿整個屏幕
- 22. 高度的ListView填滿整個屏幕,雖然設置爲WRAP_CONTENT
- 23. Android ScrollView旋轉後無法填滿整個屏幕寬度
- 24. iPad應用程序不會填滿整個屏幕
- 25. 線性佈局不填滿整個屏幕
- 26. 如何使用Bootstrap製作響應式邊欄而不填滿整個屏幕?
- 27. 如何讓離子項目的內容填滿可用空間?
- 28. 如何在Vim中獲取整個屏幕的內容?
- 29. 的GridView沒有填滿屏幕
- 30. 角度2組件未填滿屏幕
這是什麼,listview還是什麼? – 2014-10-19 12:45:42
這是相對的佈局,有3個textview和6個按鈕 – Soiks 2014-10-19 12:49:16
把所有這個視圖放在一個Realative Layout中,並使其高度,寬度如下android:layout_width =「fill_parent」android:layout_height =「fill_parent」 – 2014-10-19 12:56:11