问题
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