我已经有一段时间在处理一个问题。由于我没有真正找到解决方案,因此我希望这里的某个人能够帮助我。
我有一个UIActionSheet,我想让它具有不同的背景颜色。 使用
[[myAlert layer] setBackgroundColor:[UIColor redColor].CGColor];
我能够改变大部分警报的颜色。 这就是它的外观:
这是我初始化UIActionSheet的方式:
UIActionSheet *styleAlert = [[UIActionSheet alloc] initWithTitle:AMLocalizedString(@"SELECT_PICTURE_TITLE", @"Überschrift des Actionsheets")
delegate:self
cancelButtonTitle:AMLocalizedString(@"CANCEL_BUTTON_TITLE", @"Abbrechen butten")
destructiveButtonTitle:nil
otherButtonTitles:AMLocalizedString(@"TAKE_PICTURE_BUTTON_TITLE", @"Bild aufnehmen button"),
AMLocalizedString(@"CAMERA_ROLL_BUTTON_TITLE", @"Aus Bibliothek auswählen"), nil];
// use the same style as the nav bar
[styleAlert showInView:self.parentViewController.tabBarController.view];
//[styleAlert showInView:[self.navigationController view] ];
[styleAlert release];
并且
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet {
actionSheet.layer.backgroundColor = GLOBAL_TINT_COLOR.CGColor;
}
我不知道如何设置边框颜色相同。有什么想法吗?
提前感谢!