Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/233.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 运行到底部的内容_Android_Android Layout - Fatal编程技术网

Android 运行到底部的内容

Android 运行到底部的内容,android,android-layout,Android,Android Layout,我有一个文本视图在顶部运行到相对布局,底部有两个嵌套按钮。我尝试将margin-bottom放在top元素上,然后将margin-top和android:layout\u alignParentBottom元素放在一起,但这并没有改变文本出现在按钮上的事实。您没有提供布局文件,因此下面是一个如何避免该问题的小示例: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schem


我有一个文本视图在顶部运行到相对布局,底部有两个嵌套按钮。我尝试将margin-bottom放在top元素上,然后将margin-top和android:layout\u alignParentBottom元素放在一起,但这并没有改变文本出现在按钮上的事实。

您没有提供布局文件,因此下面是一个如何避免该问题的小示例:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/btn_bar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" >

        <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button1" />

        <Button
            android:id="@+id/button2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Button2" />
    </LinearLayout>

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/btn_bar"
        android:layout_alignParentTop="true" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="TextView" />
    </ScrollView>


</RelativeLayout>

我有一个父scrollview,因此我将父视图改为相对视图,并将一个scrollview与我的主要内容放在一起,在scrollview下面是另一个带有按钮的相对视图--谢谢!