android 中 scrollview 里面 又有一个子scrollview滑动事件冲突 外层scrollview重写一下,当滑动内层scrollview的时候就不让外层的scrollview滑动.public class MyScrollView extends ScrollView {private boolean canScroll;private GestureDetector mGestureDetector;View.OnTouchListener mGestureListener;public MyScrollView(Context context,AttributeSet attrs){super(context,attrs);mGestureDetector=new GestureDetector(context,new YScrollDetector());canScroll=true;}Overridepublic boolean onInterceptTouchEvent(MotionEvent ev){if(ev.getAction()=MotionEvent.ACTION_UP)canScroll=true;return super.onInterceptTouchEvent(ev)&mGestureDetector.onTouchEvent(ev);}public class YScrollDetector extends SimpleOnGestureListener {Overridepublic boolean onScroll(MotionEvent e1,MotionEvent e2,float distanceX,float distanceY){if(canScroll)if(Math.abs(distanceY)>;=Math.abs(distanceX))canScroll=true;elsecanScroll=false;return canScroll;}}}
android 中的 scrollView,如果快速滚动到顶端,或者最底端。滚动条会显示几秒钟后消失。如果在滚动条消失 android 中的 scrollView,如果快速滚动到顶端,或者最底端。。
怎么判断android中ScrollView滑动到了最底部 class HomepageOnTouch implements OnTouchListener {Overridepublic boolean onTouch(View v,MotionEvent event){switch(event.getAction()){case MotionEvent.ACTION_DOWN:break;case MotionEvent.ACTION_MOVE:View view=((ScrollView)v).getChildAt(0);if(view.getMeasuredHeight()()+v.getHeight()){Log.i(\"底部了\",\"底部了\");}else if(v.getScrollY()=0){}break;case MotionEvent.ACTION_UP:break;}return false;}}