Android 启动器主屏幕
在android主屏幕中,我们能够左右滑动屏幕并显示多个页面。每个页面都有一组不同的图标。在 Mac 世界中,这些被称为“空间”。它们在 Android 世界中被称为什么?
更重要的是有没有一个标准的控件可以用来达到这个效果?
In the android home screen, we have the ability to slide the screen left and right and display multiple pages. Each of these pages has a different set of icons. In the Mac world these would be called "spaces". What are they called in the Android world?
More importantly is there a standard control that can be used to achieve this effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有这样的控制来实现这一点。一旦我深入研究启动器的源代码,这种效果是通过创建几个 LinearLayout 并将它们并排放置在代码中来完成的。在“空间”中滑动是通过处理触摸事件来完成的。此外,处理小部件的网格是使用可用的 API 创建的。
There is no such control to achieve this. Once I was digging through the Launcher's source code and this effect is done by creating few LinearLayouts and placing them side by side in the code. Sliding through the "spaces" is done by handlig touch events. Also the grid that handles widgets is created using aviable API.
不幸的是,没有针对该滑动效果的标准控件。
这是另一个关于效果的问题,其中还包含关于实施它的一些建议。
Unfortunately, there isn't a standard control for that sliding effect.
This is another question about the effect which also contains a few pointers about implementing it.