I am new to iPhone development. I am creating an app where I take a picture and I must present it on the screen full screen. But I am having difficulties understanding some stuff.
For example: imagine the user selects a picture that has a different aspect ratio compared with iPad’s screen. As I am presenting the picture full screen, I don’t want to display any black bars left/right or top/bottom and I would like not to distort the picture. How do I calculate the size to display the picture. I mean, how do I calculate the picture size, based on the screen size and orientation so the picture is displayed on the screen without borders, even if the picture has to bleed.
Sorry for asking such a noob question.
Can you point me the direction? Please point me to some code, as my brain is swimming in theory and a code will help me understand that. Thanks.
You can use
UIImageViewto display image (UIImage).You can manage the behavior of displayed image (cropped, scaled to fit, centered) by changing property
contentModeofUIImageViewinstance: