Share on Google+Share on Google+

iPhone Text Field Border 

Advertisement
In this tutorial will learn about the text field Border, we can set the border of text field by selecting the text field and then Tools -> attributes Inspector and then select the different boarder for the text field.

Text Field Boarder 

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:

iPhone Textfield border

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

{

    [textField resignFirstResponder];

    [textField1 resignFirstResponder];

    [textField2 resignFirstResponder];

    [textField3 resignFirstResponder];

    [super touchesBegan:touches withEvent:event ];

}

Make connection in Interface Builder:

Finally press Build And Go button

Download Here

Advertisements

Advertisement

Posted on: September 25, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.