我在ScrollView中有一个RelativeLayout。但是,当它作为父布局时,ScrollView不会滚动。当ScrollView作为父布局时ScrollView不滚动
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:fillViewport="true"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_about_background"
android:layout_width="match_parent"
android:layout_height="150dp"
android:src="@drawable/stack" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_about_background"
android:paddingLeft="10dp"
android:paddingRight="10dp"
/>
</RelativeLayout>
</ScrollView>
编辑:我取下rootView.setOnTouchListener
从我的片段和ScrollView
工作正常
你的滚动视图结束在哪里? –
https://stackoverflow.com/questions/20896963/relativelayout-inside-scrollview-not-working –
@ Harshit Trivedi错过了复制时的行。问题更新 – Ameer