【发布时间】:2013-11-16 01:06:21
【问题描述】:
我有一个简单的故事板,其中包含一个导航控制器和一个静态表视图控制器。我添加了一个视图控制器,并通过 push segue 将其连接到其中一个单元格。我注意到的一件事是导航栏标题没有正确垂直居中,后退按钮和UIBarButtonItem。
这是它现在的样子。
请注意,它都与底部对齐。我想要的是一种向下移动标题或向上移动按钮的方法。如果按钮向上移动,则后退按钮箭头也应移动,并允许返回主表视图。
这是我用来在视图控制器中设置UIBarButtonItem 字体的代码(如果有帮助的话):
[clearButton setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"ChalkboardSE-Regular" size:15], NSFontAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
这是我用来在应用程序委托中设置后退按钮的字体didFinishLaunchingWithOptions::
[[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor], NSFontAttributeName:[UIFont fontWithName:@"ChalkboardSE-Regular" size:15]}forState:UIControlStateNormal];
【问题讨论】:
标签: ios objective-c uinavigationbar