Subviews on UIImagePicker?
I was wondering: in Apple's "Photos" app, when the user wishes to share more than one photo, 开发者_JS百科he or she can tap on the individual thumbnails, and a check in a red circle will appear on top of each one, indicating that they've been selected for sharing. Is there any way to mimic this behavior in our apps? By somehow inserting subviews on thumbnails, perhaps...? Thanks in advance.
You can't affect the thumbnail views on a UIImagePicker, so you'll have to implement this yourself. It should be pretty straightforward:
- UIScrollView will be the container
- a UIView descendant for each tile, containing
- UIImageView subview to display the thumbnail
- UIButton for the clickable checkmark
Make sure you create thumbnails of your images and cache them, and don't shy away from UIImageView - it is heavily optimized.
There is a great sample app in the WWDC sample code re: UIScrollView that should give you a good starting point.
精彩评论