如何更改图像的图标以表示已在 iPhone 上选择该图像
我试图模拟与 iPhone OS 3.X-4.0 上的默认“照片”应用程序相同的行为。 基本上,当用户通过 UIImagePickerController 从图像库中选择相册中的多张照片时,图像上会出现一个图标(勾号),表示用户已选择该图像。如何实现这个功能。
非常感谢
I am trying to simulate the same behaviour as the defaults "Photos" application found on the iPhone OS 3.X-4.0.
Basically when the user selects multiple photos in the Album via the UIImagePickerController from the Image Library,an icon (tick mark) appears on the image to represent that the image has been selected by the user. How to implement this functionality.
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用刻度线图像创建另一个 UIImageView 并将其作为子视图添加到所选的 UIImageView 中。像这样:
create another UIImageView with the tickmark-image and add it as a subview to your selected UIImageView. Like this:
只需在发布之前将这行代码放在我上面的注释中^,稍后您就可以访问所有选定的图像,将数组设置为属性,以便轻松访问
,并且在removeCheckMark函数中说:
Just put that line of code before the release in the comment above mine^ than later you can access all of the selected images, make the array a property so its easily accessible
and also in the removeCheckMark function say: