UIImageView height on iPhone 6 and iPhone 6 Plus Zoomed display mode

好久不见. 提交于 2019-12-13 05:14:22

问题


I have a UIImageView *backgroundImageView in my ViewController and call in my viewDidLoad

[self.backgroundImageView sizeToFit]

I found that on the iPhone 6 the height changes from 667 (Normal display) to 558 (Zoomed display)

However on the iPhone 6 Plus the height remains the same at 736 for both.

Is this expected?


回答1:


Try it. Here Given code based on your current screen height.

float img = frame.size.height / frame.size.width;

frame.size.width = [[UIScreen mainScreen] bounds].size.width;

frame.size.height = frame.size.width * img ;


来源:https://stackoverflow.com/questions/34618527/uiimageview-height-on-iphone-6-and-iphone-6-plus-zoomed-display-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!