UIBarButton 没有“按”按钮动画片

发布于 2024-09-19 03:29:11 字数 658 浏览 0 评论 0原文

我有一个正在加载的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜血染红嫁衣 2024-09-26 03:29:11

[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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文