If I add an image in the storyboard it resizes correctly, however if I load it programmatically it will appear larger. I am using the Xcode 10.1. I have tried both a launch.storyboard and launch images to verify I am correctly accessing the iPhone X,Xs. (7-8+,XR XsMax looks ok)
The images load correctly on XsMax and XR. I know X,Xs renders pixels differently. This is a single image, I do not use @2x, @3x etc…
I’m coding in Objective C.
if I put a UIImageView element in the storyboard view and its Frame Rectangle is (3,95) and (130×253) the image looks correct in the storyboard and when I run the simulator.
If I load the same image but do it programmatically such as:
UIImageView *dot =[[UIImageView alloc] initWithFrame:CGRectMake(3,95,130,253)]; dot.image=[UIImage imageNamed:@"apple.png"]; [TestView addSubview:dot];
The programmatically UIImageView looks larger than 130×253. Maybe a 1/3 larger?
Anyone have a solution?