Devster101
Devster101

Reputation: 578

Xcode 4.2 How to make text field fullscreen

Just a quick question, I can't seem to find any examples so far.

I am trying to make a textfield in Xcode go fullscreen when users clicks on it. All i need is the code to expand the field fullscreen so other fields etc. are not visible while the user enters text. Then once the user is finished and clicks done, the previous screen returns with the text entered saved inside the field.
Any ideas?

Thanks

Upvotes: 1

Views: 470

Answers (1)

JoeCortopassi
JoeCortopassi

Reputation: 5093

CGRect oldFrame = myTextFieldOutlet.frame;
myTextFieldOutlet.frame = CGRectMake(0,0,320,460);

...then when you want to restore it to normal...

myTextFieldOutlet.frame = oldFrame;

In fairness, I think you would be better off with a separate view for that textview you present modally (and return the text from), than what you are talking about.

Upvotes: 1

Related Questions