如何删除不必要的Andr​​oid重叠 [英] How to remove unwanted overlapping in android

查看:107
本文介绍了如何删除不必要的Andr​​oid重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使一个Android界面,但我有一点点重叠的问题。

I'm trying to make an Android interface, but I have a little overlapping issue.

下面是我的code。它是一个标签,但我切了制表的部分路程。如果你需要的话,我会添加它。

Here is my code. It is in a Tab, but I cut the Tab-part away. If you need it, I'll add it.

更新:我忘了​​写,我有很多的TextView的,不仅是

<FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <ScrollView
                android:orientation="vertical"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent">

                <LinearLayout
                    android:orientation="vertical"
                    android:layout_height="fill_parent"
                    android:layout_width="fill_parent">

                <TextView
                    android:text="welcome"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentTop="true" />

                <!-- A lot of TextView as the one above -->

                </LinearLayout>
            </ScrollView>

            <RelativeLayout
                android:id="@+id/InnerRelativeLayout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true" >

                <Button
                     android:id="@+id/add"
                     android:layout_height="wrap_content"
                     android:layout_alignParentRight="true"
                     android:layout_width="fill_parent"
                     android:text="@string/add" />
            </RelativeLayout>
        </RelativeLayout>
    </FrameLayout>

而这正是它输出。正如你所看到的,在底部,文云后面的按钮,但我想有他们在两个不同的布局

And this is what it outputs. As you can see, in the bottom, the text goes behind the button, but I want to have them in two different layouts

推荐答案

尝试将它定位在按钮上面的比较

Try to position it relatively above the button.

<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <ScrollView                
            android:orientation="vertical"
            android:layout_above="@+id/InnerRelativeLayout" //Add this
            android:layout_height="fill_parent"
            android:layout_width="fill_parent">

            <LinearLayout
                android:orientation="vertical"
                android:layout_height="fill_parent"
                android:layout_width="fill_parent">

            <TextView
                android:text="welcome"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true" />

            </LinearLayout>
        </ScrollView>

        <RelativeLayout
            android:id="@+id/InnerRelativeLayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true" >

            <Button
                 android:id="@+id/add"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
                 android:layout_width="fill_parent"
                 android:text="@string/add" />
        </RelativeLayout>
    </RelativeLayout>
</FrameLayout>

这篇关于如何删除不必要的Andr​​oid重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆