如何在iPhone 5的UIActionSheet中对齐按钮文字?
答案 0 :(得分:0)
使用这种方式,您可以设置框架,更改字体以及操作表上按钮文本的对齐方式。
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 = @"Your Title";
[sheet addSubview:newTitle];
[sheet release];