gpt4 book ai didi

iphone - 有什么方法可以更改 UIActionSheet 中的标题字体大小吗?

转载 作者:行者123 更新时间:2023-12-03 18:31:50 24 4
gpt4 key购买 nike

字体非常小,有些人难以阅读,因此我希望使其更接近其下方按钮所使用的字体大小。

最佳答案

您可以在显示方法(如 showFromBarButtonItem)之后更改字体属性,如下所示。

CGRect oldFrame = [(UILabel*)[[sheet subviews] objectAtIndex:0] frame];
UILabel *newTitle = [[[UILabel alloc] initWithFrame:oldFrame] autorelease];
newTitle.font = [UIFont boldSystemFontOfSize:17];
newTitle.textAlignment = UITextAlignmentCenter;
newTitle.backgroundColor = [UIColor clearColor];
newTitle.textColor = [UIColor whiteColor];
newTitle.text = @"My Title";
[sheet addSubview:newTitle];

[sheet release];

关于iphone - 有什么方法可以更改 UIActionSheet 中的标题字体大小吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3919875/

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