Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Text Field Height

How do I make a text field in xcode larger than one line. Stone Preston

2 Answers

You need to use a UITextView for multi line input.

How would I make the border on the UITextView the same as the TextField's border?

Stone Preston

I managed to make the UITextView have the same border as the text field because I also wanted to extend the text field as well but couldn't manage it.

I connected the TextView's I added to the storyboard to my code (etc. TestViewController.h) by control dragging to the h file. In the implementation file (.m), inside the viewDidLoad I added this.

[self.cloudTechText.layer setBorderColor:[[[UIColor grayColor] colorWithAlphaComponent:0.5] CGColor]];
[self.cloudTechText.layer setBorderWidth:0.5];
self.cloudTechText.layer.cornerRadius = 5;
self.cloudTechText.clipsToBounds = YES;

this essentially places the border around the textview just like it would in the textfield.