I had Used UICollectionView to show three images in each cell in portrait and landscape mode using AutoLayout. Fetch images from server to load in UICollectionView data. In iphone 4s and 5 working little better but iphone 6 and 6 plus Image stretching issue in portrait and landscape mode. I had tried AspectFit but i need to fill image in full space. I had spent more time with this so How to solve this issue? please let me your suggestions.
Thanks in Advance
FYI, Screenshot
You need to use AspectFill
AspectFit Keeps the aspect ration, but showing all the image, therefore it won't fill your imageView, and AspectFill keeps the aspect ratio, and filling your imageView, therefore it wont show all the image, think about it like sort of cropping the image to fit in your imageView.
Related
I am stuck with a minor problem (which according to our testers is an issue), that is, the image provided for LaunchScreen gets cropped in iPhone X,* models.
I have been trying to render the image itself on storyboard from Attributes Inspector but it is of no use. Since coding isn't allowed for LaunchScreen, I can't change the UIImageView properties programmatically.
I have set the contentMode for the UIImageView to scaleAspectFill. And hence it gets cropped.
Is there any way to fit the image corner to corner for each iPhone model on LaunchScreen?
iPhone 6 displays the image perfectly but it's not a good thing for the iPhone XR screenshot provided here.
Please help!
I have two storyboards, an iPhone and an iPad. Under the iPhone in the storyboard to UIScrollView is already connected UIImageView correctly, when running on the simulator, everything works correctly and xcode does not issue any warnings. And in the storyboard for ipad tried to connect the same UIIMageView to the UIScrollView, but it does not work out correctly and without prejudices.
For different devices, there are two different images with different size, for iPhones a picture with a size of 7+, and for the iPad, the picture size for 12.9. When you start the simulator 7+, the picture by height is displayed completely to the entire height of 7+, and the width is scaled to the right, the width of the picture is large. Accordingly, on smaller iPhones, when displaying a picture, in height it will take up more space than the height of the phone screen and will also scroll up / down + to the right. The same effect I try to achieve and for ipad. I tried to bind everything via reset to suggested, as well as just add the constants for UIImageView relative to UIScrollView, but still it does not work. Although I do everything the same way as I did for an iPhone. Please help. Thank's
My project https://yadi.sk/d/WU7tjwEv3NNRm6
enter image description here
I really need help, I made an app I designed everything for iphone 7 I designed it with constraints and now I am having a problem because they don't look right on SE or 4s.
I am using circles made with IBDesignables(using cornerRadius to make circles). I want them when it resizes to stay circles because I tried couple of things and when it resizes its not a circle anymore.
Sorry for the long paragraph I just really need a tip !
How can I solve this problem
Here is how it looks on Iphone 7
Here is how it looks on Iphone SE
Here is how it looks on Iphone 4s
If you want to keep that all view stay circle for all device you must keep their height and width same.
You can easily do this thing with Autolayout set Aspect ratio of that view is 1 so their height and width remain same check screen shot
I want to have the same background for every size of iPhones and iPads using scale to fill mode.
This is my background:
This is how my Image View looks in Xcode:
The question is why it doesn't scale to fill when I run this on emulator (iPhone 4s)?
Any ideas for this problem?
Set constrain of imageView as below image. Add adding 4 Constrain.
OUTPUT :
I read as much as I can of auto-layout tutorials but I cannot figured out how I can have my UIView (UIWebView for that specific example) resize to the screen layout of my phone.
My background is an UIImageView, proportionally bigger on iPhone5, and iPhone6 and iPhone6 plus .
I want to have my UIWebview to get the margin keeping the aspect ratio.
I tried several options (I also enabled size classes option - I did not see any difference on the preview...)
Anyone as a clue on that ?
It looks like you're not getting any answers here, and I'm not sure I can help, either; but, I'd like to try by offering what I've done with respect to maintaining the aspect ratio of a given view containing a video, no matter whether the iPhone orientation is portrait or landscape.
In my storyboard, I've accounted for occasions in which the aspect ratio is reversed, in that all videos are either 16:9 or 9:16, but which one depends on how the camera was held during recording:
So, here is a screen shot of an iPhone displaying a 16:9 (wide) video in portrait:
Here is the same video (wide) in landscape (ignore the overlapping labels; the Core Data section is meant to be hidden or overlapped by the AVPlayer view, so that users can view the video fullscreen by simply rotating the iPhone):
Here are the opposites, first:
And, second:
These run the gamut of possibilities for maintaining aspect ratio, regardless of a portrait or landscape orientation, and regardless of a horizontal or vertical aspect ratio. Therefore, you should be able to derive a solution from it. Hope this helps!