一个片段有两个视图一个FrameLayout包含一些子视图,在FrameLayout下面有一个viewPager。 我想更换片段时有一个像ACTION_MOVE上的FrameLayout的动作,让我上的FrameLayout添加onTouchListener但它从来没有工作,viewPager效果很好,也是FrameLayout里的孩子们的观点具有onClick事件FrameLayout上面的viewPager片段中的onTouch事件拦截了bean
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.hall_gift, container,
false);
frameLayout = (FrameLayout)view.findViewById(R.id.fans_body_title);
frameLayout.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction()==MotionEvent.ACTION_DOWN){
Log.i(TAG,"ACTION DOWN");
}
return false;
}
});
return view;
}
由“framlayout” ,你的意思是'FrameLayout',对吧? – APerson 2014-09-25 02:18:08
是的!抱歉拼写错误! – Sunday 2014-09-25 02:27:36
张贴您的代码请 – mmlooloo 2014-09-25 02:33:08