iOS横竖屏旋转及其基本适配方法 - 梧雨北辰的博客 - CSDN博客
适配主要需要得到
/*屏幕宽度*/
staticinlineCGFloattScreenWidth() {
if ([UIScreen mainScreen].bounds.size.width>[UIScreen mainScreen].bounds.size.height) {
return [UIScreen mainScreen].bounds.size.height;
}else{
return [UIScreen mainScreen].bounds.size.width;
}
}
/*幕高度*/
staticinlineCGFloattScreenHeight() {
if ([UIScreen mainScreen].bounds.size.width>[UIScreen mainScreen].bounds.size.height) {
return [UIScreen mainScreen].bounds.size.width;
}else{
return [UIScreen mainScreen].bounds.size.height;
}
}
网友评论