Closed AkhilBabu349 closed 6 years ago
Hi @AkhilBabu349, thanks for your question. Sorry, can you clarify what you mean by that? Maybe draw a picture? :)
The image loaded from url show different size as the device change ho to make it to same width in all device
See the image has been loaded in different sizes as the device is changed
Thanks for the screenshots. A picture is worth a thousand words!
By default Auk uses .scaleAspectFit
setting, which always shows the entire image without cropping. One can change that to .scaleAspectFill
, and the image will fill the entire scroll view:
// Make the images fill entire page
scrollView.auk.settings.contentMode = .scaleAspectFill
In your case .scaleAspectFill
will crop a little bit from the top and bottom of the image on wide devices. If you want to avoid cropping AND make images as wide as the screen, you will need to change the layout of your scroll view. If all your images have same aspect ratio, say 16:9, then one can use an auto layout constraint with this aspect ratio. This way, the scroll view will always be 16:9 and the images will fill it entirely with default .scaleAspectFit
setting.
Let me know if it helps. :)
Yes it worked thank u : )
No worries, I'm glad it worked!
same issue but already resolved thanks
How to load images as adaptable for all device universally with equal width as the device