如何“滚动”不确定大小的视图?
我编写了一个自定义视图,用于显示可平铺的图案,并希望用户能够放大(我已经介绍过),然后在图案内移动。
因为图案是可平铺的,这意味着它实际上没有边界。理论上,用户可以永远向左(向右、向上或向下)滚动。实际上,我会使用模数来调整虚拟位置。
我只是不知道从哪里开始。我会使用带有滚动条的东西吗?我不确定这是否有意义,因为正如我所说,可视区域实际上是无限的。
感谢您的任何建议!
I have written a custom View which is used to display a tileable pattern, and want the user to be able to zoom in (which I've got covered) and then move around within the pattern.
Because the pattern is tileable it means that there are effectively no bounds on it. In theory a user could just keep scrolling left (right, up, or down) forever. In reality I would be using a modulus to adjust the virtual position.
I'm just not sure where to start. Would I use something with scrollbars? I'm not sure that makes any sense, because as I said the viewable area is effectively infinite.
Thanks for any suggestions!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用滚动视图并关闭滚动条。
I'd use a scrollview with the scrollbars turned off.
我认为滚动视图是不必要的。我真正要做的就是处理触摸事件,然后相应地调整虚拟坐标。
I decided a scrollview was unnecessary. All I really had to do was handle the touch events and then adjust the virtual coordinates accordingly.