How to add subview (UITextView) in UIalertview in iOS7.

Total Post:67

Points:471
 5622  View(s)
Ratings:
Rate this:

How to add subview (UITextView) in UIalertview in iOS7.

  1. Post:51

    Points:359
    Re: How to add subview (UITextView) in UIalertview in iOS7.

     
     UIAlertView *alertview=[[UIAlertView alloc] initWithTitle:@Title message:nil delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
     alertview.delegate=self;
     
    UITextView*  TextView=[[UITextView alloc]initWithFrame:CGRectMake(0, 0,100,100)]; 
      TextView.autocorrectionType=UITextAutocorrectionTypeNo;
        TextView.textColor =[UIColor blackColor];
        TextView.textAlignment= NSTextAlignmentLeft;
     
     
     if(floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
         
        [alertview addSubview:TextView];
        } else {
         [alertviewTextView forKey:@"accessoryView"];
        }
        [alertview show];

      Modified On Apr-09-2018 01:29:20 AM

Answer