1

iPhone5のUIActionSheetでボタンテキストを揃えるには?

4

1 に答える 1

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];
于 2013-04-09T05:33:36.247 に答える