跳转到新页面,页面里包含srollview,scrollview里又含有listview或者recyclerview,这时候经常会进入页面就发现页面不是在最开始的地方
解决方法:在scrollview的第一个子布局里添加
android:focusable="true"
android:focusableInTouchMode="true"
例:
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
`