【问题标题】:Set UIView position in portrait and landscape在纵向和横向中设置 UIView 位置
【发布时间】:2014-06-03 01:47:29
【问题描述】:

我已经创建了一个加载器视图。我已经使用以下代码设置了指示器的位置:

    loadingView = [[UIView alloc]initWithFrame:CGRectMake(455, 225, 80, 80)]

如何为纵向模式设置不同的位置? 谢谢

【问题讨论】:

    标签: ios objective-c uiview


    【解决方案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
    }
    

    【讨论】:

      猜你喜欢
      • 2017-07-10
      • 2012-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-31
      相关资源
      最近更新 更多