I am trying to display images on the iPhone in the same way that the Photo app does. It seems to be able to dynamically select UIViewContentModeScaleAspectFit or UIViewContentModeScaleAspectFill depending on what is appropriate for the image. Where possible I would like images to appear full screen but if not then I would like them to appear UIViewContentModeScaleAspectFit
Ccna final exam - java, php, javascript, ios, cshap all in one. This is a collaboratively edited question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
Friday, February 24, 2012
Dynamically use UIViewContentModeScaleAspectFit and UIViewContentModeScaleAspectFill
Tags
ios,
iphone,
objective-c,
Tips For Programmer,
uiimageview
Subscribe to:
Post Comments (Atom)
When you have an image check the size of the image, and then have a test or something.
ReplyDeleteif (imageSize > screenSize){
imageView.contentMode = UIViewContentModeScaleAspect..
}else{
imageView.contentMode = UIViewContentModeScaleAspect...
}
Hope this helps!
Tams