我创建了一个加载器视图。我已使用以下代码设置指标的位置:
loadingView = [[UIView alloc]initWithFrame:CGRectMake(455, 225, 80, 80)]
如何为肖像模式设置不同的位置? 感谢
答案 0 :(得分:1)
if([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait)
{
//portrait
loadingView = [[UIView alloc]initWithFrame:CGRectMake(225, 455, 80, 80)];//any position you want
}
else
{
//landscape
loadingView = [[UIView alloc]initWithFrame:CGRectMake(455, 225, 80, 80)];//any position you want
}