将元素放在父项RelativLayout中的元素上方

时间:2018-09-11 15:17:32

标签: java android android-layout kotlin android-relativelayout

我想将TextText“ singleName”元素放在父RelativeLayout的ViewPager上方,是否可以?

此处xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v4.widget.NestedScrollView
            android:id="@+id/singleScroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            >

            <RelativeLayout
                android:id="@+id/indicatorWrapper"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/singleName"
                    android:layout_width="wrap_content"
                    android:layout_height="@dimen/slider_height" />

            </RelativeLayout>

        </android.support.v4.widget.NestedScrollView>

        <android.support.v4.view.ViewPager
            android:id="@+id/singleSlider"
            android:layout_width="match_parent"
            android:layout_height="@dimen/slider_height"/>

    </RelativeLayout>

有没有建议?

2 个答案:

答案 0 :(得分:0)

尝试将其添加到您的ViewPager:

android:layout_below="@id/singleScroll"

答案 1 :(得分:0)

怎么样?

sed 's/^ *([^)]*)/\n&\n/;1i (not released yet)'

这应将viewpager放在屏幕底部,嵌套的滚动布局应填充在屏幕的其余部分。

相关问题