操作单自然会使背景视图变灰,但并不是很明显。我想把它弄得更黑。
此外,我如何使它,使您不能单击其他任何地方?现在,如果您单击操作表的外部,它会使操作表消失。我不希望这种情况发生-你应该按下“取消”按钮,以使行动单消失。
发布于 2014-03-25 19:47:26
你可以尝试这样的方法:
@property (nonatomic, strong) UIView *shadowView;
- (void)willPresentActionSheet:(UIActionSheet *)actionSheet
{
if (!self.shadowView)
{
self.shadowView = [[UIView alloc]initWithFrame:self.view.bounds];
self.shadowView.backgroundColor = [UIColor colorWithRed:(42.0/255.0) green:(42.0/255.0) blue:(42.0/255.0) alpha:1.0];
self.shadowView.alpha = 0.7;
[self.view addSubview:self.shadowView];
}
else
{
self.shadowView.alpha = 0.7;
}
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
self.shadowView.alpha = 0.0;
}https://stackoverflow.com/questions/22644723
复制相似问题