gpt4 book ai didi

iphone - 导航项更改字体颜色/alpha?

转载 作者:行者123 更新时间:2023-12-03 20:34:42 24 4
gpt4 key购买 nike

有没有办法改变navigationItem上显示的文本的颜色或alpha?目前它是亮白色的,我(如果可能的话)想把它稍微调低一点,这样它就不那么亮了。任何信息将不胜感激。

- (void)loadView {
[[self navigationItem]setTitle:@"Location List"];
...
...

enter image description here

最佳答案

您需要使用 setTitleView 代替并给它一个标签 - 像这样:

UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 30)];
titleLabel.textColor = [UIColor redColor];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.text = @"My Title";
[self.navigationItem setTitleView:titleLabel];

关于iphone - 导航项更改字体颜色/alpha?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4862831/

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