设置 Android Gallery 小部件以显示特定的起始图像
我有一个任务,用户可以从 GridView 中选择代表相册的图像,并从此开始一个新的活动,该活动显示一个图库小部件以显示相册的图像。但是,我似乎无法让图库小部件以给定图像作为起点来显示相册的内容。理想情况下,我想要一个 Gallery#setStartingImage(intposition) 或类似的东西。
任何想法将不胜感激。
I have a task where the user can select an image from a GridView representing a photo album, and from this I start a new activity which displays a Gallery widget to show the images of the photo album. However, I can't seem to get the Gallery widget to show the contents of the photo album with a given image as the starting point. Ideally I would like a Gallery#setStartingImage(int position) or something similar.
Any ideas would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在深入研究了 Gallery 的继承层次结构后,我发现在 Gallery 扩展的 AbsSpinner 类中定义了 setSelection() 方法。这似乎可以完成工作。
After looking a little deeper into the inheritance hierarchy of Gallery, I found the method setSelection() defined in the AbsSpinner class which Gallery extends. This seems to do the job.