在活动之间滑动 [英] Swipe between activities
问题描述
我想在活动之间滑动,但我不确定最佳做法是什么.
I want to swipe between activities, but I'm not sure what best practices would be.
我是否应该一次将所有内容都放入并从每个活动中滚动?...这会造成内存问题吗?
Should I throw everything in at once and scroll from each activity?...and does that create memory problems?
还是我最好实施实际的滑动?
Or am I better off implementing an actual swipe?
我还应该考虑其他方法吗?
Are there other methods I should consider?
最终游戏将是 10-15 个填充 HTML 的活动,组成一本杂志……所以我希望用户能够从每篇文章(每个活动 1 篇)滑动到另一篇文章.
The end-game will be 10-15 Activities filled with HTML, making up a magazine...so I want the user to be able to swipe from each article (which will be 1 per activity) to another.
谢谢!
推荐答案
您也可以使用 GestureDetector 和 OnGestureListener 启动使用 public boolean onFling() 检测到投掷时的新意图.
You could also use GestureDetector and OnGestureListener to launch a new Intent when a fling is detected with public boolean onFling().
我个人会按照 kabuko 所述使用 ViewPager.
Personally I would use the ViewPager as described by kabuko.
这篇关于在活动之间滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!