android - 内容进入alignparentbottom

标签 android android-layout

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/

相关文章:

android - 自定义抽屉导航布局 (xml)

android 和 facebook - 将自定义操作发布到用户墙上

java.lang.UnsatisfiedLinkError : Native method not found: com. ziqitza.murgency.activities.FibLib.getTestString:()Ljava/lang/String;

android - 我在 list AAPT : error: resource mipmap/ic_launcher_round not found 中有错误

java - 如何在apk中插入新文件?

android-layout - 影响工具栏样式和定位的抽屉导航片段

android - 以编程方式设置 RecyclerView 的顶部填充不起作用?

java - 在模拟器中加载插页式广告时出现 AdMob 错误

android - NestedScrollView 内的 MapView 不滚动

Android:RecyclerView onClick Listener 未获取