TabBar 控制器选择颜色

发布于 2024-08-22 07:59:52 字数 66 浏览 6 评论 0原文

有没有人实现过 TabBar 控制器应用程序,在选择选项卡项时它显示除灰色和蓝色之外的不同颜色?

谢谢

Is there any one who has implemented for the TabBar Controller application in which on selection of tab item it shows different colour other than gray and blue color?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

所有深爱都是秘密 2024-08-29 07:59:52

您可以使用以下命令更改所选按钮的颜色

self.tabBar.selectedImageTintColor = [UIColor blackColor];

和使用以下命令更改选项卡栏背景颜色:

self.tabBar.tintColor = [UIColor whiteColor];

但仅限 iOS 5.0

You can change the selected button color with:

self.tabBar.selectedImageTintColor = [UIColor blackColor];

and the tabbar background color with:

self.tabBar.tintColor = [UIColor whiteColor];

but only iOS 5.0

懒猫 2024-08-29 07:59:52

正如我已经在这里发布的: 更改 iOS 7 上的选项卡栏色调颜色

有一种更简单的方法可以做到这一点。

只需打开文件检查器并选择“全局色调”。

您还可以在 Interface Builder 中设置应用程序的色调颜色。文件检查器的 Interface Builder Document 部分中的 Global Tint 菜单可让您打开“颜色”窗口或选择特定颜色。

另请参阅:

https://developer.apple.com /library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html

As I already posted here: Change tab bar tint color on iOS 7

There is an much easier way to do this.

Just open the file inspector and select a "global tint".

You can also set an app’s tint color in Interface Builder. The Global Tint menu in the Interface Builder Document section of the File inspector lets you open the Colors window or choose a specific color.

Also see:

https://developer.apple.com/library/ios/documentation/userexperience/conceptual/TransitionGuide/AppearanceCustomization.html

∝单色的世界 2024-08-29 07:59:52

试试这个:

UITabBarController *tabBarC = [[UITabBarController alloc] init];

if ([[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending) {
    tabBarC.tabBar.selectedImageTintColor = [UIColor redColor];
}

记住,仅限 iOS5+。

Try this:

UITabBarController *tabBarC = [[UITabBarController alloc] init];

if ([[[UIDevice currentDevice] systemVersion] compare:@"5.0" options:NSNumericSearch] != NSOrderedAscending) {
    tabBarC.tabBar.selectedImageTintColor = [UIColor redColor];
}

Remember, only with iOS5+.

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