3

UIActionSheet的显示时是透明的。我该如何改变?这是问题的截图:

在此处输入图像描述

编码:

   - (IBAction)btnTakePicture_Clicked:(id)sender
{
    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Image from..." delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Camera", @"Image Gallary", nil];
    actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
    actionSheet.alpha=0.90;
    actionSheet.tag = 1;
    [actionSheet showInView:self.view];
    UIButton *btn = (UIButton *)sender;
    intButton = btn.tag;
}
4

2 回答 2

3

我相信造成问题的原因是

actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;

可能在 iOS 7 中,这会导致透明度。尝试删除它。

此外,您将 alpha 设置为 0.9,这在任何情况下都会导致一些透明度(虽然不是屏幕截图中显示的那样)。如果您想要一个完全不透明的操作表,请同时删除

actionSheet.alpha=0.90;
于 2013-10-25T15:52:56.467 回答
2

删除行:

 actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
 actionSheet.alpha=0.90;

应该做的伎俩

于 2013-10-25T15:52:59.397 回答