Home > DeveloperSection > Forums > How to add subview (UITextView) in UIalertview in iOS7.
Alex Leblois
Alex Leblois

Total Post:67

Points:471
Posted on    February-12-2015 7:19 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 3059  View(s)
Rate this:

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



Hugh Jackman
Hugh Jackman

Total Post:52

Points:366
Posted on    February-12-2015 7:20 AM

 

 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];


Don't want to miss updates? Please click the below button!

Follow MindStick