简体   繁体   English

苹果用于导航栏标题的字体和大小是多少?

[英]Which font and size does apple use for the navigation bar title?

I made an totally custom navigation bar and would like to use the exact same font and size like apple does for the title of their navigation bar. 我做了一个完全自定义的导航栏,并希望使用与苹果公司导航栏标题完全相同的字体和大小。 It looks like some kind of fat printed arial, but not sure if that's right. 它看起来像某种脂肪印刷的arial,但不确定这是否正确。 Does anyone know? 有人知道吗?

iOS12 Large Title System Bold 34 (San Francisco) iOS12大型标题系统Bold 34(旧金山)

[UIFont boldSystemFontOfSize:34]

iOS9 - iOS12 System Semibold 17 (San Francisco) iOS9 - iOS12系统Semibold 17(旧金山)

[UIFont systemFontOfSize:17 weight:UIFontWeightSemibold]

iOS8 System Semibold 17 (Helvetica Neue) iOS8系统Semibold 17(Helvetica Neue)

[UIFont systemFontOfSize:17 weight:UIFontWeightSemibold]

iOS7 System Bold 17 (Helvetica Neue) iOS7系统Bold 17(Helvetica Neue)

[UIFont boldSystemFontOfSize:17];

Definitely not Arial. 绝对不是Arial。 It's Helvetica. 这是Helvetica。 You can probably get the same font using 您可以使用相同的字体

UIFont *navFont = [UIFont boldSystemFontOfSize:18];

Change the size to find out what Apple is using (and write it below in a comment if you find the best one). 更改大小以找出Apple正在使用的内容(如果找到最佳内容,请在评论中将其写在下面)。

All the navigation bar text has a white shadow underneath it to give it the embossed effect. 所有导航栏文本下方都有一个白色阴影,以赋予其浮雕效果。 It's a white shadow 1 pixel underneath the text. 它是文本下方1个像素的白色阴影。 Use shadowColor and shadowOffset in a UILabel to get the same effect. UILabel使用shadowColorshadowOffset可以获得相同的效果。

对于iOS7,正确的字体大小为17pt:

UIFont *navFont = [UIFont boldSystemFontOfSize:17];
UIFont *navFont = [UIFont boldSystemFontOfSize:22];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM