【问题标题】:Using UIAppearance to move UINavigationBar使用 UIAppearance 移动 UINavigationBar
【发布时间】:2012-06-06 16:48:29
【问题描述】:

我正在尝试通过UIAppearance 增加UINavigationBar 的高度

高度本身确实发生了变化,但部分栏被设备状态栏遮挡。我想将条形图向下移动 22 像素,使其完全可见:

[[UINavigationBar appearance] setFrame:CGRectMake([[UINavigationBar appearance] frame].origin.x, 22, [[UINavigationBar appearance] frame].size.width, 103)];

我还设置了自动调整大小的掩码

[[UINavigationBar appearance] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin];

但是没有翻译吧。这里有其他方法或其他步骤吗?

【问题讨论】:

    标签: ios ios5 uinavigationbar uiappearance


    【解决方案1】:

    您只能通过以下方式下移标题:

    [[UINavigationBar appearance] setTitleVerticalPositionAdjustment:5 forBarMetrics:UIBarMetricsDefault];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-30
      • 1970-01-01
      • 2011-07-30
      • 1970-01-01
      相关资源
      最近更新 更多