【发布时间】:2014-01-24 02:13:09
【问题描述】:
我想使用文本设置为 @"+" 的 UILabel 看起来像 iOS 7 中的 UIBarButtonSystemItemAdd。到目前为止,我已经...
UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 35, 35)];
[lbl setText:@"+"];
[lbl setFont:[UIFont systemFontOfSize:36]];
[lbl setTextAlignment:NSTextAlignmentCenter];
addButton = [[UIBarButtonItem alloc] initWithCustomView:lbl];
...但问题是 + 不在导航栏的垂直中心。我试过改变标签的框架,但 + 总是出现在同一个地方,有点太低了。
有什么想法吗?
【问题讨论】:
-
比较截图会很有帮助
标签: iphone objective-c ios6 ios7 uibarbuttonitem