1、得到当前屏幕的尺寸:
CGRect rect_screen = [[UIScreenmainScreen]bounds];
CGSize size_screen = rect_screen.size;
2、获得scale:
CGFloat scale_screen = [UIScreen mainScreen].scale;
3、获取分辨率
CGFloat width = size_screen.width*scale_screen;
CGFloat height = size_screen.height*scale_screen;
时间: 2025-01-09 03:40:06