如何在活动上获得右/左箭头以指示右/左更多屏幕?
我有一个 ViewFlipper,其中包含一些线性布局。
我需要允许用户翻阅它们。
我见过其他应用程序在屏幕两侧都有箭头/三角形指示器,按下时会翻转到集合中的下一个视图。
我想将这些添加到我的活动中。
I have a ViewFlipper which contains a few linear layouts.
I need to allow the user to flip through them.
I've seen other apps which have arrow/triangle indicators on either side of the screen, which, when pressed, flips to the next view in the set.
I'd like to add these to my Activity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,它不包含在 ViewFlipper 中。你必须自己实施它。为此,只需定义两个不想显示箭头的图像。然后您可以使用 getDisplayedChild() 和 getChildCount() 方法来计算是否有下一个/上一个翻转器。据此您可以设置箭头图像。
This is not included in the ViewFlipper by default. You have to implement it by yourself. For that just define two Images where you wan't to show the arrows. Then you can use the methods getDisplayedChild() und getChildCount() to calculate if there is a next/previous flipper. According to that you can set your arrow images.