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

Alex Leblois

Total Post:67

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

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

  1. Hugh Jackman

    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

NEWSLETTER

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