Android(安卓)ScrollView自动滑动一段距离的问题解决
16lz
2022-04-14
问题出现的原因是因为ScrollView中子布局的的焦点的变化导致ScrollView自动的滑动 。所以解决方法就是让ScrollView中的最外层子布局焦点固定。
<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”
便能解决问题。
更多相关文章
- Android中实现整个视图切换的左右滑动效果
- Android(安卓)GestureDetector手势识别类
- Android:使用ViewPager实现左右滑动切换图片 (简单版)
- Android使用ViewPager实现左右滑动效果
- android 禁止viewpager预加载
- Android(安卓)TextView setMovementMethod 滑动 背景
- android实战
- Android实现手势滑动(左滑和右滑)
- Android(安卓)activity 单手操作 滑动关闭