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