iphone获取屏幕尺寸以及状态栏

获取状态栏的尺寸

CGRect rect;


rect=[[UIApplication sharedApplication]statusBarFrame];


获取屏幕尺寸


CGRect rect;

rect=[[UIScreen mainScreen]bounds];

CGSize size=rect.size;

CGFloat width=size.width;

CGFloat height=size.height;

NSLog(@"%f",width);

NSLog(@"%f",height);

你可能感兴趣的:(ios,iPhone,状态栏,屏幕尺寸)