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

Total Post:67

Posted on    February-12-2015 7:19 AM

 iPhone iPhone  Ios  Objective C 

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

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

Hugh Jackman
Hugh Jackman

Total Post:52

Posted on    February-12-2015 7:20 AM


 UIAlertView *alertview =[[UIAlertView alloc] initWithTitle:@Title message:nil delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];



UITextView*  TextView=[[UITextView alloc]initWithFrame:CGRectMake(0, 0,100,100)];



    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