ios - Get screen width and height only in portrait -
how screen width , height in landscape orientation , have 2 ipad 4 tablets , on 1 of them takes me landscape width & height , , on other 1 takes me portrait 1 if it's orientation on lanscape
at moment using not working well
cgfloat width = self.view.bounds.size.width; cgfloat height = self.view.bounds.size.height;
use [uiscreen mainscreen].bounds
you'll have same.
discussion rectangle specified in current coordinate space, takes business relationship interface rotations in effect device. therefore, value of property may alter when device rotates between portrait , landscape orientations.
use [uiscreen mainscreen].nativebounds
in ios8 portrait-locked bounds.
discussion rectangle based on device in portrait-up orientation. value not alter device rotates.
ios
No comments:
Post a Comment