I am developing a universal application for iOS-7. This specific question is specific to iPad only. I want to put the image as the background of the root representation of the view controller, that is, the image should fill the entire screen. 1x image has a size: 768x1024. This works for portrait orientations, since the iPadβs non-mesh resolution is also 768x1024 in portrait. However, the image is not suitable in the landscape. I tried to use ScaleToFit, but since the aspect ratio of the image was not preserved, I can not use ScaleToFit (their images in the image look odd if they are not scaled proportionally along both axes). Resizing AspectFill seems the most suitable for my needs, but this is a small problem. As defined in the Apple documentation "Content Modified,to completely fill the border rectangle while preserving the aspect of the content.Content is centered on an axis that exceeds it. ". I donβt want the content to be centered on the axis in which it exceeds, I want it to be aligned with the top / left edge.
So basically I want two things:
- Filling aspect
- Content remains aligned left / top.
Is it possible to achieve this. Any piece of code will be great.
thank
Taha source
share