按钮和笛卡尔坐标
我有这个滚动视图“渴望”充满按钮(每行 4 个),并且类似于 iphone 应用程序图标,我希望用户能够根据她/他的意愿重新排列它们。如果它只是一排按钮,Apple Autoscroll 教程应用程序将是一个很好的例子。事实并非如此,这是二维的,我不知道该怎么做。尝试了几个想法: 一个数组,将按钮坐标作为参考;此时此刻,我正在尝试找到一种方法来拾取坐标比被拖动的按钮“更低/更少”的按钮。我一直在寻找和研究但没有成功。有什么数学算法可以做到这一点吗?我怀疑还有其他一些经过严格测试且可靠的解决方案。你能指出一些吗? 非常感谢。
I have this scrollview "eager" to be filled up with buttons (4 per row), and resembling iphone apps icons, I want the user to be able to rearrange them has she/he pleases. If it were one row of buttons only, Apple Autoscroll tutorial app would be an excellent example to follow. Not the case, this is 2D and I cannot figure out how to do it. Couple of ideas tried: An array keeping buttons coordinates as reference; at this moment I'm trying to find out a way to pick up the buttons that have "lower/lesser" coordinates than the one being dragged. I've been searching and researching with no success. Any mathematical algorithm to do this? I suspect there are some other solutions out there seriously tested and robust. Can you pin point some?
Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不使用
TTLauncherView
?Why don't you use the
TTLauncherView
?