HOW TO ADD SUBVIEW (UITEXTVIEW) IN UIALERTVIEW IN IOS7.

Alex Leblois

Total Post:67

Points:471
Posted by  Alex Leblois
 4819  View(s)
Ratings:
Rate this:

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

  1. Hugh Jackman

    Post:52

    Points:366
    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];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!