ios - Get screen width and height only in portrait -


How to get the width and height of the screen in the landscape orientation, I have two iPad 4 tablets and on one of them Landscape Width & amp; Height, and on the other it takes me a picture even though this orientation is on lanscape

I am using this at the moment, but it is not working well

  CGFloat Width = self.view.bounds.size.width; CGFloat height = self.view.bounds.size.height;  

Use [UIScreen main screen] .bounds You

talk
This rectangle is specified in the current coordinate area, which takes into account any interface rotation for the device. Therefore, the value of this property can change when the device rotates between the portrait and landscape orientation.

Use the [UIScreen main screen]. Nativebounds IOS8 only to get image-lock limitations.

Discussion
This rectangle is based on a picture-up orientation on the device. This value does not change in the form of a device rotate.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -