Android 主屏幕使用按钮滚动到下一个屏幕以及滑动位
我正在制作一个具有类似于主屏幕样式的滚动屏幕的应用程序。我已经实现了这个解决方案:
它效果很好,但我也希望您在每个页面上都有按钮可以点击进入下一页,但我就是不知道该怎么做!有人可以帮忙吗?我已经盯着这个代码好几天了!
谢谢
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
更新-帮助
我真的不明白如何解决从其他活动调用 SetToScreen 的问题,任何人都可以帮忙,就像我尝试一样,我确实不断收到静态调用错误。
I am making an app that has a scrolling screen like the homescreen style. I have implemented this solution:
It works great but I also want there to be buttons on each page that you can click to go to the next page but I just can't figure out how to do it! can someone help? I've been staring at this code for days now!
Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UPDATE - HELP
I really don't understand how to get around the problem of calling the SetToScreen from the other activity, Can anyone help as if I try I do keep getting Static call errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
使用此功能单击即可设置屏幕。
您应该通过添加一个函数来扩展 Draggablespace 来获取当前空间,例如:
然后您可以在活动中编写自己的函数,就像
上一个屏幕一样。
现在,您只需检查前进或后退时是否有额外的屏幕在等待。
(当然,draggableSpace 是draggablespace 类的对象......不是静态调用!)
Look at
Use this function to set to a screen on a click.
you should extend Draggablespace by adding a function to get the current space like:
then you can write your own functions in your activity like
The same for previous screen.
Now you only need to check if there is an additional screen waiting if you are going forward or backward.
(Of course draggableSpace is your object of the class draggablespace...not a static call!)