Hi everyone,
I would like to get the iphone screen size to give calculation, but I did not found any documentation how to get it. Would you please figure it out for me?
Thanks
Hi everyone,
I would like to get the iphone screen size to give calculation, but I did not found any documentation how to get it. Would you please figure it out for me?
Thanks
You can use the bounds
property on an instance of UIScreen:
CGRect screenSize = [[UIScreen mainScreen] bounds];
Most people will want the main screen; if you have a device attached to a TV, you may instead want to iterate over UIScreens and get the bounds for each.
More info at the UIScreen class docs.
Use the property bounds
of UIView
if you want to know the size of a certain view or [[UIScreen mainScreen] bounds]
if you want to know the screen size of the device.