【发布时间】:2013-12-16 12:53:24
【问题描述】:
确定按钮不起作用。 我知道它发生了,因为我添加了 backgroundImageView。 我怎样才能让它工作?
这是我的代码:
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"clock"]];
backgroundImageView.frame = CGRectMake(0, 0, 282, 200);
backgroundImageView.contentMode = UIViewContentModeScaleToFill;
backgroundImageView.userInteractionEnabled = YES;
[alert addSubview:backgroundImageView];
[alert sendSubviewToBack:backgroundImageView];
[alert show];
【问题讨论】:
-
同样的代码对我有用。也许一些不同的东西会与你的 alertView 重叠,比如 tapGestureRecognizer 或其他子视图。
标签: ios objective-c uiimageview uialertview addsubview