How to get iPhone screen size programmatically? [duplicate]
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How to get screen size using code? NSLog(@"Top Left View : Width %f height%f",self.topLeftView.frame.size.width,self.topLeftView.frame.size.height); I have dragged the "View" from object library and put it on xib file. But what if I want to get the screen size to check whether its iphone 4,iPhone 3 or iphone 5 or any iOS Device. So that I can arrange other views accordingly. 回答1: You can use: CGsize screenSize =