why would [[UIScreen mainScreen] scale] return 0?
-
09-10-2019 - |
문제
I thought I was doing something relatively simple, but I guess not.
Running:
NSLog(@"%f",[[UIScreen mainScreen] scale];
returns 0.000000
The problem is that I am trying to check for a retina display and the:
if([UIScreen respondsToSelector:@selector(scale)] &&
[[UIScreen mainScreen] scale] == 2.0) {
// does not get called on an iPhone 4
}
Doesnt get called. I have tried this both in the simulator as well as on the device.
해결책
I guess the answer is How to call [[UIScreen mainScreen] scale] in a universal app for the iphone and ipad
제휴하지 않습니다 StackOverflow