Reputation: 1939
I find that in ios 4 , I can not use:
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
So, how can I achieve the same effect as the code above in ios4?
Upvotes: 0
Views: 107
Reputation: 2962
UITextField * textField = [[UITextField alloc] init];
textField.frame = CGRectMake(0, 0, 0, 0); //Your properties here
[alert addSubview:textField];
I would suggest defining the textfield globally so that you have access to it from within the whole class, and can retrieve the text input.
Upvotes: 1
Reputation: 33421
You will have to set an object to be the alert view's delegate and override its appearance in willPresentAlertView: the way you do any other UIView (adding subviews).
Upvotes: 0