ios - 使用 UIAppearance 移动 UINavigationBar

标签 ios ios5 uinavigationbar uiappearance

我正在尝试通过 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];

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

最佳答案

你只能通过这个向下移动标题:

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

关于ios - 使用 UIAppearance 移动 UINavigationBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10918547/

相关文章:

ios - 创建宽度等于 TableView 分隔符宽度的 View

facebook - 包括已弃用的 Facebook header 文件夹会出错

ios - 使用 Storyboards 设置自定义导航栏

ios - iOS 10中如何获取Apple Maps的 'parked location'的 'find my car'信息

ios - 使用图像选择器后,图像未显示在ImageView中

iphone - 来自另一层cocos2d的ccmenuitem

ios5 - 如何将自定义着色器与 GLKit 一起使用

iphone - 在 iPhone 导航栏上绘制自定义后退按钮

ios - 以编程方式添加一个与状态栏重叠的 UINavigationBar

objective-c - 从 View 引用 ViewController 中的数组时出错