gpt4 book ai didi

iphone - 更改 NavigationItem 的字体

转载 作者:行者123 更新时间:2023-12-03 18:20:21 26 4
gpt4 key购买 nike

我使用此代码更改 NavigationItem 的标题:

self.navigationItem.title = @"My Name is ABC";

如何更改字体大小和字体?

最佳答案

示例代码:

CGRect frame = CGRectMake(0, 0, 400, 44);
UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont boldSystemFontOfSize:8.0];
label.textAlignment = UITextAlignmentCenter;
label.textColor = [UIColor whiteColor];
label.text = @"Sample custom Title With small Fonts ";
self.navigationItem.titleView = label;

关于iphone - 更改 NavigationItem 的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2771541/

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