Height and width for landscape mode is showing wrong
问题 I have used this method for detecting the width and height of screen. But its showing the width as 768 and height as 1024 in portrait and landscape also. CGRect screenBounds = [[UIScreen mainScreen] bounds]; float widthfloat= screenBounds.size.width; float heightfloat= screenBounds.size.height; NSLog(@" width float %f",widthfloat); NSLog(@"height float %f",heightfloat); NSLog(@"width view %f \n height view %f", self.view.bounds.size.width, self.view.bounds.size.height); NSLog(@"width %f \n