I have a custom UIView with textfield, button and UIWebView. I want to add this custom UIView to UIAlertView to show on Screen. Can I do that? Thanks
- 
                    2You can, but you shouldn't – borrrden Jul 19 '13 at 09:03
 - 
                    Dont do all this , your app will get rejected by apple .please read HIG Guidelines. – Kasaname Jul 19 '13 at 09:05
 - 
                    Because I want to show it on Screen and disable all interaction of UIViewController push UIAlertView – HTKT611 Jul 19 '13 at 09:06
 - 
                    Look at http://stackoverflow.com/questions/2600779/how-can-i-customize-an-ios-alert-view – βhargavḯ Jul 19 '13 at 09:07
 - 
                    If you use this customize alert for your app, it might get rejected by Apple. – βhargavḯ Jul 19 '13 at 09:11
 - 
                    See My Answer Try this one. and let me know..... – Jitendra Jul 19 '13 at 10:00
 
4 Answers
You indeed can do that, however your app will get rejected, as described in the Human Interface Guidelines by Apple. If you still want to do that then just [alertView addSubview:view]; will work.
I would suggest making your own UIAlertView, but with more unified design and better UX than how it would look in the UIAlertView.
- 3,609
 - 3
 - 24
 - 58
 
Why go for adding and showing in custom alertview .You can show it in a subview and present it using the addSubview: method
Note the purpose of alertview is to present an alert and it alone is the sole purpose.The UIView is there for the purpose of presenting it
- 19,955
 - 12
 - 56
 - 101
 
- 
                    I know but if i add UIVIew on UIVIewController, i cannot disable interaction of UIVIewController when UIView appear – HTKT611 Jul 19 '13 at 09:27
 - 
                    Well in that case I will suggest the custom libraries like SVProgressHUD for the purpose – Lithu T.V Jul 19 '13 at 09:28
 - 
                    
 - 
                    @HTKT611 Sorry wrong Library Use RNBlurModalView.I used it in somne of the application and works like charm – Lithu T.V Jul 19 '13 at 09:33
 
yes,you can add,need to set proper frames and all those things like button actions on the view.
 UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"test" message:@"\n\n\n\n\n\n\n\n\n\n\n" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
    UIView *view= [[UIView alloc]initWithFrame:CGRectMake(0, 0, 300, 300)];
    view.backgroundColor = [UIColor redColor];
    [alert addSubview:view];
    [alert show];
- 8,470
 - 2
 - 24
 - 41
 
Try this Code i am adding Label.
delegate.alert=[[UIAlertView alloc]initWithTitle:@"Password" message:@"\n\n\n\n\n" delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
    delegate.lbl=[[UILabel alloc]init];
    delegate.lbl.frame=CGRectMake(60, 42, 200, 18);
    delegate.lbl.backgroundColor=[UIColor clearColor];
    [delegate.alert addSubview:delegate.lbl];
Adding like this whatever your control but only setting Frames Properly... As per your Need..
- 5,055
 - 2
 - 22
 - 42