守候你守候我
试着运行下面的代码- (void)viewDidLoad {
[super viewDidLoad];
UIWindow *w = [[UIApplication sharedApplication] keyWindow];
UIView *v = [w.subviews objectAtIndex:0];
NSLog(@"%@", NSStringFromCGRect(v.frame));
NSLog(@"%@", NSStringFromCGRect(v.bounds));}此代码的输出是:CASE设备定位是肖像{{0, 0}, {768, 1024}}{{0, 0}, {768, 1024}}CASE设备定位是景观{{0, 0}, {768, 1024}}{{0, 0}, {1024, 768}}显然,您可以看到帧和界之间的区别。