gpt4 book ai didi

objective-c - iPad UIBarButtonItem 不服从色调

转载 作者:行者123 更新时间:2023-11-29 11:09:54 24 4
gpt4 key购买 nike

所以这可能是一个非常愚蠢的问题,但我无法让普通的 UIBarButtonItem 变成白色。这是一个基本的 UIBarButtonItem,它在顶部工具栏项目中显示日期,我希望它显示为白色,但它看起来像灰色,正如您从两张图片中看到的那样以及我拥有的 IB 设置。

我什至尝试以编程方式设置色调,但没有显示差异。它可能很简单,但我无法为我的生活弄清楚。非常感谢任何可能帮助我找到答案的人,我真的很感激。

How the uibarbuttonitem is displayed in the app

The settings of the UIBarButtonItem

最佳答案

我最终使用了 setTitleTextAttributes 选择器,因为就像我假设的那样......这是一个非常简单的解决方案

这是我对可能偶然发现此问题的任何人的修复

[_titleItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, [UIColor darkGrayColor], UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, -1.0)], UITextAttributeTextShadowOffset, nil] forState:UIControlStateNormal];

关于objective-c - iPad UIBarButtonItem 不服从色调,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12029255/

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