TabHost,滑动意图失败
这个标题并没有公正地表达我的问题,但我们开始吧。我按照教程向应用程序内的活动添加了滑动操作。现在,此活动嵌套在 TabHost 内。但是,当应用程序运行时,滑动操作在 TabHost 内部不起作用,但在单独调用 Activity 时却起作用。
如果您需要代码,我会发布它,但出于商业原因我宁愿不发布。
The title does my issue no justice but here we go. I followed a tutorial and added a swipe action to an activity inside my app. Now this activity is nested inside a TabHost. However, when the application runs, the swipe action is not working when inside the TabHost, but it does work when the activity is individually called.
If you need the code I will post it, but I would rather not for business reasons.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我想通了。代码如下:
}
发生的事情是在
onTouchEvent(MotionEvent event)
中,我必须删除if()
语句和else()
语句并转动gestureDetector.onTouchEvent(event);return false; 语句到
return true;
我希望这对其他人有帮助。我正在继续努力获得恒定的流畅运动,以便视图跟随用户的手势。
Ok I figured it out. Here is the code:
}
What happened was in the
onTouchEvent(MotionEvent event)
I had to remove theif()
statement andelse()
statement and turn thegestureDetector.onTouchEvent(event);
statement toreturn false;
return true;
I hope this helps someone else. I am continuing work to get a constant fluid motion so that the views follow the users gesture.