使用自定义字体时,如何垂直校正navigationBar的titleView文本位置? [英] How do I vertically correct the navigationBar's titleView text position when using a custom font?

查看:79
本文介绍了使用自定义字体时,如何垂直校正navigationBar的titleView文本位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在导航栏中为titleView使用自定义字体。
不知怎的,Apple总是把这个字体画得太高了。

We're using custom fonts for the titleView in the navigation bar. Somehow Apple always draws this font too high.

如何在导航栏中使用自定义字体时纠正这个奇怪的偏移?

How do I correct for this strange offset you get when you are using custom fonts in a navbar?

推荐答案

我使用 setTitleVerticalPositionAdjustment:forBarMetrics:

兼容性:从iOS 5开始提供。

Compatibility: available starting from iOS 5.

这篇关于使用自定义字体时,如何垂直校正navigationBar的titleView文本位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆