The Ok button is not working. I know it happened because I added backgroundImageView. How can i make it work?
This is my code:
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];
Don't add subviews to
UIAlertView
, it is not supported functionality. If you need to create custom views, find a 3rd parts alert view solution which supports what you need and use that instead.