已解决:layout_height参数在按钮栏定义中设置为Match_parent。更改为wrap_content。使用嵌套的LinearLayout
我目前正在研究一个新的应用程序,它在主屏幕的顶部有一系列按钮。 “buttonBar”XML定义了一个linearLayout,后来嵌套在另一个linearLayout中。
按钮显示正常,但是如果我然后将文本视图置于包含语句之下,文本不会出现。我认为它实际上出现在按钮后面。我认为,因为它在一个父线性布局中,它会出现在包含的(嵌套的)嵌套布局之后。
请有人解释为什么这不会发生,并指出我在正确的方向来解决它。
大加赞赏, 中号
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<include layout="@layout/buttonheader"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:id="@+id/textView1"
android:textColor="#ffffff">
</TextView>
</LinearLayout>
布局如果您解决您的问题yourslef的
width
,发布你的答案并接受它。 – inazaruk