Android layout Android应用程序RelativeLayout未显示

Android layout Android应用程序RelativeLayout未显示,android-layout,Android Layout,因此,我尝试在屏幕底部使用基本应用程序选项卡的相对布局,但当我将其放置在LinearLayout中,在其他两个布局(LinearLayout和ScrollView)之后,却没有显示出来。ScrollView包含几个文本视图,它自己可以很好地滚动,而linearlayout也可以很好地工作,但是我尝试在屏幕底部放置的relativelayout不起作用。 以下是我尝试执行的操作的一般代码: <?xml version="1.0" encoding="utf-8"?> <L

因此,我尝试在屏幕底部使用基本应用程序选项卡的相对布局,但当我将其放置在LinearLayout中,在其他两个布局(LinearLayout和ScrollView)之后,却没有显示出来。ScrollView包含几个文本视图,它自己可以很好地滚动,而linearlayout也可以很好地工作,但是我尝试在屏幕底部放置的relativelayout不起作用。 以下是我尝试执行的操作的一般代码:

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:orientation="vertical"
    android:background="@drawable/common_bg"
    android:layout_height="fill_parent">

    <LinearLayout android:layout_width="fill_parent"
        android:layout_height="50dp">

        <TextView android:layout_height="50dp"
            android:text="Heading"
            android:gravity="center"
            android:textSize="17dp"
            android:textColor="@color/white"
            android:textStyle="bold"
            android:layout_width="fill_parent">
        </TextView>
    </LinearLayout>

    <ScrollView android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbars="none"
        android:layout_gravity="top" 
        android:layout_marginBottom="60dp">

           <LinearLayout android:layout_width="fill_parent"
            android:orientation="vertical"
            android:paddingTop="15dp"
            android:layout_weight="1"
            android:paddingLeft="15dp"
            android:paddingRight="15dp"
            android:layout_height="fill_parent">

           <TextView android:layout_width="wrap_content"
                         android:textColor="@color/white"
                         android:textSize="18dp"
                         android:textStyle="bold"
                         android:text="@string/text"
                 android:layout_height="wrap_content">
           </TextView>


           </LinearLayout>

    </ScrollView>

    <RelativeLayout
        android:id="@+id/bottomMenu"
        android:layout_width="wrap_content"
        android:layout_height="60dp" />

</LinearLayout>
更新:我使用的相对布局是自定义的,我不能在这里实际显示它的代码,但它包含一个带有几个按钮的单选组


更新2:好的,所以我解决了这个问题,通过操纵3个布局上的布局高度=包裹内容,第一个是线性布局,一个是拿着滚动条的布局,另一个是底部相对布局,以及操纵每个布局的布局高度,直到我对它的外观感到满意。。。这似乎不是最好的解决方案,但它奏效了,所以我不能抱怨太多lol…

相对布局本身不会显示在xml图形布局中,或者当您运行应用程序时,它需要一个子元素来占据父布局,尝试将文本视图放在相对布局中,它将被显示,将其放置在具有滚动视图的线性布局的正下方,它将正常工作,我刚刚用您的代码尝试了它,它工作了

但仍然不工作。我甚至冗余地将scrollview包含在linearview中,但作为relativeview的底部菜单仍然不会出现。我让eclipse向我展示了图形视图,但它向我展示了底部菜单在屏幕下方,就好像scrollview占据了整个屏幕,并排除了其他任何内容一样。现在,当我尝试将其放入scrollview时,relativeview底部菜单确实出现了,它只是出现在滚动线性布局的底部。。。有没有办法解决这个问题?