viewgroup使用的问题 viewgroup中有几个view,通过手指控制屏幕滑动切换view,但是有一个问题是所有的view都获取不到焦点,请问该怎么做呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是不是处理的OnTouchEvent?然后上层组件已经接管了 ? 一个viewgroup。里面3个view.每个view里又封装了一个activity..这怎么弄 public class Test extends Activity implements GestureDetector.OnGestureListener{ private GestureDetector mGestureDetector; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGestureDetector = new GestureDetector(this); } @Override public boolean onTouchEvent(MotionEvent event) { return mGestureDetector.onTouchEvent(event); } public boolean onDown(MotionEvent e) { return false; } public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { return true; } public void onLongPress(MotionEvent e) { } public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { return false; } public void onShowPress(MotionEvent e) { } public boolean onSingleTapUp(MotionEvent e) { return false; } //子view监听 class ChildTouchListener implements OnTouchListener{ @Override public boolean onTouch(View v, MotionEvent event) { mGestureDetector.onTouchEvent(event); return true; } }} 滑动切换实现了啥 然后给子view 加监听 如OnTouchListener 重写onTouch方法 是要跳转还是其他 看你 最后在这个方法中调用哈前面的onTouchEvent 为什么我的建的控件里面的图都不能填充控件 一个android笔记软件中遇到的问题,求大神指教啊 初学android,有个问题想请教大神们 Android 开发平台的搭建问题 新手求问Android界面开发疑问 封装数据接受的问题,大家进来看看 关于DLNA/upnp相关的问题 android 下 调用so 创建文件 百度定位SDK3.3定位失败 Notification跳转问题 ContentProvider一点问题 ExpandableListView如何能立即实时显示出新的赋值?
public class Test extends Activity implements GestureDetector.OnGestureListener{ private GestureDetector mGestureDetector;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGestureDetector = new GestureDetector(this);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
return mGestureDetector.onTouchEvent(event);
}
public boolean onDown(MotionEvent e) {
return false;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
return true;
} public void onLongPress(MotionEvent e) { } public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
return false;
} public void onShowPress(MotionEvent e) { } public boolean onSingleTapUp(MotionEvent e) {
return false;
}
//子view监听
class ChildTouchListener implements OnTouchListener{
@Override
public boolean onTouch(View v, MotionEvent event) {
mGestureDetector.onTouchEvent(event);
return true;
}
}
}