突出显示选定的图库查看项目
我有一个 GalleryView,它始终显示 100 张图片。中心图片(默认情况下在应用程序加载时或当用户单击水平滚动列表中的另一张图片时)显示在 ImageView 下方的较大空间中。我想在 GalleryView 中突出显示所选图片,可能具有比其他图片更亮的边框,以便它作为用户选择的图片脱颖而出。现在,即使中心图片处于焦点中,它也具有与旁边的其他图片相同的边框、外观和感觉。我希望它在视觉上有所区别。
有人可以帮助我开始吗?
谢谢,
艾布
I have a GalleryView which displays 100s of pictures at all times. The central picture (by default on application load or when user clicks on another picture in the horz. scroll list) is displayed in the larger space below in an ImageView. I would like to highlight the selected picture in the GalleryView, maybe with a brighter border than the rest so that it stands out as the user-selected picture. Right now, even though the central picture is in focus, it has the same border and look and feel like the rest of the pictures next to it. I would like it to be visually differentiated.
Can anyone help me get started?
Thanks,
Ab
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用此 xml 在单击时突出显示 gridview 中的视图:
selector.xml
其中,highlight_border 是您拥有的可绘制边框,它是突出显示的边框。
然后在包含每个 gridview 元素的 xml 文件中,输入:
grid_view_element.xml
Use this xml to highlight a view in your gridview when it's clicked on:
selector.xml
Where highlight_border is a drawable you have that is a highlighted border.
Then in your xml file containing what each gridview element looks like, put this:
grid_view_element.xml