http://dl.dropbox.com/u/24856/android_issue.PNG
我在顶部有一个 TextView ,进入相对布局,底部有两个嵌套按钮。我尝试将 margin Bottom 放在顶部元素上,然后将 margin top 和 android:layout_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>
关于android - 内容进入alignparentbottom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9858933/