Scrollview中内容改变后自动滑动到底部的问题
将scrollview包裹的内容设置上以下俩个熟悉
android:focusable="true"
android:focusableInTouchMode="true"
ScrollView子view变化后自动滑动到edittext焦点位置问题
滚动 , 重写EditText
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_MOVE)
this.getParent().requestDisallowInterceptTouchEvent(true);
return super.onTouchEvent(event);
}
焦点跳动, 重写ScrollView
@Override
public boolean requestChildRectangleOnScreen(View child, Rect rectangle, boolean immediate) {
return child instanceof EditText;
}
网友评论