如何将视图添加到图库?
我有多个列表视图,想将它们添加到图库中。
我尝试使用 addView 但不支持它,因为 Gallery 视图是 AdapterView。
有人可以让我知道该怎么做吗?
问候
苏尼尔
I have multiple ListViews and would like to add those to Gallery.
I tried with addView but it is not supported since Gallery view is an AdapterView.
Can someone let me know how to go about it?
Regards
Sunil
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不太可能奏效。
Gallery
或ListView
滚动可能无法运行。正确的。
您需要创建一个包含
ListViews
的Adapter
,并将该Adapter
交给您的Gallery
。That is unlikely to work. Either the
Gallery
or theListView
scrolling probably will not function.Correct.
You will need to create an
Adapter
containing yourListViews
, and hand thatAdapter
to yourGallery
.有关如何将 Gallery 类与 Adapter 一起使用的示例,请参见此处。本示例中的适配器提供图像。您可以提供您的 ListViews
An example on how to use the Gallery class together with an Adapter can be found here. The adapter in this example provides images. You could provide your ListViews