In order to layout some views in my app, I have:
CGRect bounds = [UIScreen mainScreen].bounds;
CGFloat currentCenter = bounds.size.width/2;
CGFloat currentHeight = bounds.size.height;
Now, when I run this on iPhone, iPad (and those simulators) on different generations, those values work as expected, but when I run this on "MyMac (designed for iPad)," it’s not. I assume this is supposed to work on any platform under “Universal” concept…. Or is there anything I’m missing to make it work on MyMac?
By the way, I found the values are vary depends on the platform.
CGRect bounds = [UIScreen mainScreen].bounds;
CGFloat currentCenter = bounds.size.width/2;
CGFloat currentHeight = bounds.size.height;
Now, when I run this on iPhone, iPad (and those simulators) on different generations, those values work as expected, but when I run this on "MyMac (designed for iPad)," it’s not. I assume this is supposed to work on any platform under “Universal” concept…. Or is there anything I’m missing to make it work on MyMac?
By the way, I found the values are vary depends on the platform.