I am developing an iOS app.I am using auto resize(not auto layout) for designing view.But my deisgn is suitable for iphone 10.It looks stretched.Please guide me to deisgn using auto resize.iphone 10 will only support autolayout?Please refer my screenshots iphone10 ,iphone5.In xib iteself,while i am changing iphone-X it looks like this
Asked
Active
Viewed 360 times
-3
-
1You need to provide some screenshots of your design/IB because we can't help you with this amount of informations. – Apr 18 '18 at 08:03
-
It looks stretched ..? is not clear – Anbu.Karthik Apr 18 '18 at 08:07
-
add some info for e.g ui or code else something – Anbu.Karthik Apr 18 '18 at 08:09
-
@Anbu.karthik I have added screens.Please refer that – Madhu Apr 18 '18 at 08:43
-
@Madhu Uncheck height from autoresize for `imageView`. Also use contentMode `aspectFit`. – TheTiger Apr 18 '18 at 09:23
-
@Madhu - check the answer – Anbu.Karthik Apr 18 '18 at 09:42
-
`Safe Area Layout` is best option to design with iPhone-X. Use [Safe Area of Xcode 9](https://stackoverflow.com/questions/44492404/safe-area-of-xcode-9/45334411#45334411) – Krunal Apr 18 '18 at 09:55
2 Answers
0
It looks like autoresizing is not keeping aspect ratio in iPhone X and newer. So that layout based on autoresizing doesn't look good anymore on these new models.
The workaround I'm using is specifying the aspect ratio I want manually. For example if I want the circular label to stay circular on all devices, instead of turning into elipse, I adjust hight to be equal width manually:
self.frame.size.height = self.frame.size.width