itenyh
itenyh

Reputation: 1939

How to get a alert view wieh textinput in ios4

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

Answers (2)

Fernando Cervantes
Fernando Cervantes

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

borrrden
borrrden

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

Related Questions