本文介绍了有没有办法在UIActionSheet中更改标题字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
字体非常小,有些人难以阅读,所以我想让它更接近下面按钮上使用的字体大小。
The font is very small and hard for some to read so I'd like to make it closer to the font size used on the buttons below it.
推荐答案
您可以在show方法之后更改字体属性(如showFromBarButtonItem),如下所示。
You can change font property after show method(like showFromBarButtonItem) as below.
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];
这篇关于有没有办法在UIActionSheet中更改标题字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!