当我检查 4 英寸或 3.5 英寸屏幕时,我想在视图加载时移动几个按钮,但它什么也没做!为什么这行代码不起作用?即使与自己。顺便说一句,它不起作用。
- (void)viewDidLoad
{
CGRect screenbounds = [[UIScreen mainScreen]bounds];
if(screenbounds.size.height == 568){
checkbox1.frame = CGRectMake(0, 0, 30, 30);
}else{
if ([[UIScreen mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] &&
([UIScreen mainScreen].scale == 2.0)) {
} else {
}
}
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}