Android ScrollView自動スライド距離の問題解決
1533 ワード
問題の原因は、ScrollView中性子レイアウトの焦点の変化によってScrollViewが自動的にスライドすることにある.解決策は、ScrollViewの最外層サブレイアウトフォーカスを固定することです.
LinearLayoutにandroid:focusable="true"android:focusableInTouchMode="true"を加えると問題が解決します.
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true">
LinearLayout>
ScrollView>
LinearLayoutにandroid:focusable="true"android:focusableInTouchMode="true"を加えると問題が解決します.