Thursday, 26 September 2013

UITextField issue in iOS 7

UITextField issue in iOS 7

UIAlertView with UITextField not working in iOS 7. How to fix ?
Here is ScreenShot:
Here is my code:
How can I get UITextFeield in UIAlertView in iOS7 ?
-(void)takeUserName
{
mChangePlayerAlert = [[UIAlertView alloc] init];
mChangePlayerAlert.title = title;
mChangePlayerAlert.message = @"\n";
mChangePlayerAlert.delegate = self;
[mChangePlayerAlert addButtonWithTitle:@"Save"];
[mChangePlayerAlert addButtonWithTitle:@"Cancel"];
CGRect frame;
frame = CGRectMake(20, 45, 245, 27);//(200, 500, 400, 120);
mTextFeild = [[UITextField alloc] initWithFrame:frame];
mTextFeild.textColor = [UIColor blueColor];
mTextFeild.borderStyle = UITextBorderStyleRoundedRect;
mTextFeild.keyboardType = inType;//;
mTextFeild.returnKeyType = UIReturnKeyDone;
mTextFeild.autocorrectionType = UITextAutocorrectionTypeNo;
mTextFeild.autocapitalizationType = UITextAutocapitalizationTypeNone;
mTextFeild.delegate = self;
[mChangePlayerAlert addSubview:mTextFeild];
mTextFeild.delegate = self;
[mTextFeild becomeFirstResponder];
[mChangePlayerAlert show];
}

No comments:

Post a Comment