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 trialFernando Boza
25,384 Pointshow to change UITextField's height
Am trying to make my text field a bit bigger but i can only control the width not the height, any tips ?
3 Answers
Stone Preston
42,016 Pointsthis post explains how to do it in code as well as storyboard if you scroll down a bit
looks like you have to use a height constraint if you want to do it in storyboard
Fernando Boza
25,384 PointsYea thanks, i found the answer by Brian, changing the border type allowed me to alter the height
Matthew Mascioni
20,444 PointsHm, that's strange! If you're using Interface Builder, go to 'Product' > 'Clean' to clean the build folder first.
If you're doing it through code, you could theoretically force the height to change by modifying its frame rectangle. I'm going to assume you've already declared a UITextField named textField:
[textField setFrame:CGRectMake(textField.frame.origin.x, textField.frame.origin.y, textField.frame.size.width, new height)];
Hope that helps! If it doesn't, post your code and someone will try and help you out further :)
Fernando Boza
25,384 PointsHi Matthew, I was using the interface builder for the Build a Self-Destructing App. The only solution was changing the border type.
Matthew Mascioni
20,444 PointsNeat! Glad you got it solved :)