UIBarButton 没有“按”按钮动画片
我有一个正在加载的 UIView,它有一个带有“完成”栏按钮的导航栏。当我将导航栏保留为默认颜色时,一切都很好。当我将其设置为黑色时,“完成”按钮可以正常工作,但它没有按钮通常具有的按下动画。看起来不像按钮被按下。有谁知道这是为什么?
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle: NSLocalizedString(@"Done", @"")
style:UIBarButtonItemStyleDone
target:self
action:@selector(donePressed:)]
autorelease];
太感谢了!
I have a UIView that I am loading and it has a navigation bar with a 'Done' barButton. When I leave the navigation bar the default color, everything is fine. When I make it have a black tint, the 'Done' button works fine but it does not have the pressing animation that buttons usually have. It doesn't look as thought the button is being pressed. Does anyone know why this is?
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]
initWithTitle: NSLocalizedString(@"Done", @"")
style:UIBarButtonItemStyleDone
target:self
action:@selector(donePressed:)]
autorelease];
Thank you so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
[UIColor blackColor] 不为推送效果提供第二种颜色。最好的选择是在导航栏上使用 darkGreyColor,或者如果您确实需要黑色,那么您必须自己设置动画。
我听说黑色没有第二种颜色的原因是因为没有比黑色更暗的颜色。
[UIColor blackColor] does not supply a second color for the push effect. Your best best bet is to use darkGreyColor on the navigationBar or if you really need black then you'll have to animate this yourself.
I've heard that the reason black doesn't have a second color is because there is no color darker than black.