UIScreen类

 CGRect screenBounds = [ [UIScreen mainScreen]bounds];//返回的是带有状态栏的Rect
     NSLog(@"%@", NSStringFromCGRect(screenBounds));

    CGRect viewBounds = [ [UIScreen mainScreen]applicationFrame];//不包含状态栏的Rect
     NSLog(@"%@", NSStringFromCGRect(viewBounds));

    CGRect statusBarRect = [[UIApplication sharedApplication]statusBarFrame];
     NSLog(@"%@", NSStringFromCGRect(statusBarRect));

 

posted @ 2014-06-25 14:09  菜鸟程序猿  阅读(383)  评论(0编辑  收藏  举报