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. pygame.display.set_mode填滿整個屏幕
- 2. 如何讓桌子填滿整個手機屏幕?
- 3. 你如何讓窗戶填滿整個屏幕?
- 4. 如何讓ListView行填滿屏幕?
- 5. 如何讓BorderLayout填滿屏幕?
- 6. CSS:頁面內容未填滿整個屏幕
- 7. 動作條(android.support.v7)填滿整個屏幕
- 8. 工具欄填滿整個屏幕
- 9. dplyr :: tbl_df填滿整個屏幕
- 10. RelativeLayout將不會填滿整個屏幕
- 11. Gridview並沒有填滿整個屏幕
- 12. fill_parent不填滿整個屏幕在LinearLayout
- 13. Android工具欄填滿整個屏幕
- 14. ActionBarCompat上薑餅填滿整個屏幕
- 15. Admob橫幅未填滿整個屏幕
- 16. RecyclerView項目填滿整個屏幕
- 17. 如何讓td內容填滿整個家長?
- 18. JWPlayer填滿整個屏幕,無論屏幕分辨率
- 19. 讓Textview文字填滿屏幕?
- 20. 如何讓最後一個div拉伸填滿屏幕?
- 21. 如何防止UILabel填滿整個屏幕?
- 22. 如何創建填滿整個屏幕的垂直div?
- 23. 如何讓容器填滿整個窗戶?
- 24. 如何讓圖像填滿整個容器?
- 25. 在XUL中,如何讓我的列表框填滿屏幕?
- 26. 內聯svg填充整個屏幕
- 27. ListView不填滿屏幕
- 28. GridLayout不填滿屏幕
- 29. Android:填充整個屏幕的內容低於
- 30. 製作一個div填滿屏幕
這是什麼,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