gpt4 book ai didi

ios - 为什么我的标签栏呈现为灰色矩形?

转载 作者:行者123 更新时间:2023-11-29 00:07:49 25 4
gpt4 key购买 nike

enter image description here

// Tabbar
// Icon inactive
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor darkGrayColor]} forState:UIControlStateNormal];
// Icon active
[[UITabBar appearance] setTintColor:PRIMARY_COLOR];
// Text active
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: PRIMARY_COLOR} forState:UIControlStateSelected];
// Background
[[UITabBar appearance] setBarTintColor:WHITE_COLOR];
// Over View YES/NO
[[UITabBar appearance] setTranslucent:NO];

文本和图标周围有一个灰色矩形。为什么?我该死的错误在哪里?

enter image description here

最佳答案

经过讨论,我们发现@CeccoCQ 对UIView 使用了另一种设置。这使得每个 View 都有自定义背景颜色(在图像中,它是灰色)。

[[UIView appearance] setBackgroundColor:WINDOW_BACKGROUND_COLOR];

要解决此问题,请删除此自定义设置,一切都会正常进行。

关于ios - 为什么我的标签栏呈现为灰色矩形?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47514091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com