这是我编写的用于显示 UIActionSheet
的代码。
actionSheet = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"updateresponseforrecurring", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:
NSLocalizedString(@"updateresponseonlyforthis", nil),
NSLocalizedString(@"updateresponseforallactivities", nil),
nil];
actionSheet.tag = 2;
[actionSheet showInView:[UIApplication sharedApplication].keyWindow];
这是我使用此代码得到的结果:
显然,第二个选项更长,因此大小会变小以适应宽度。
但我希望所有选项都有相同的字体大小,这只能使用多行文本实现。也尝试过使用UIAlertController
,但无法设置多行文本。
如何实现?