In this tutorial will learn about the text field Boarder, we can set the boarder of text field by selecting the text field and then Tools -> attributes Inspector and then select the different border for the text field. This project is View Based Application and here will take four text field and will set create a variable for the text field, after creating will connect it through Interface builder.
Final view will look like this:
Here will create variable for each text field so that the text field can be connected and after that will write the touchsBegan method in.m file to hide the keyboard when you click on the view so that you can write or enter the text into the text field without any problem. After doing this will open Interface builder by clicking the view controller nib file and then will add text fields to the view, after adding will select each text field and then go to tools -> attributes Inspector and select different boards for each.
Add this to view controller.h file:
IBOutlet UITextField *textField;
IBOutlet UITextField *textField1;
IBOutlet UITextField *textField2;
IBOutlet UITextField *textField3;
Add this to view controller.m file:
-(void) touchesBegan :(NSSet *) touches withEvent :(UIEvent *)event
[super touchesBegan:touches withEvent:event ];
Make connection in Interface Builder:
Finally press Build And Go button
Posted on: September 25, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles