【发布时间】:2018-09-11 15:17:32
【问题描述】:
我想将元素TextView“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>
有什么建议吗?
【问题讨论】:
-
你需要 NestedScrollView 吗?你试过
layout_above或layout_below吗? -
@peshkira 是的,我需要滚动视图,而 layout_above 不适用于父级 RelativeLayout
标签: java android android-layout kotlin android-relativelayout