I am not able to change the height of UITextField statically in xCode 6. If I try it in new project than also I am getting same problem. It seems that it is fixed for all.
Thanks in advance
You can change the border style from here
You can not change UItextField height if its button style is RoundedRect. Check out https://stackoverflow.com/a/19002274/244519 for details.
Try changing the height constraint for the textfield :
Here the height is 30, you may change it to whatever you want.
Try to change border style from attribute inspector. as here
Related
Size of MDCFilledTextField/MDCOutlinedTextField is not changeable and it's fixed.
Any idea to change Material TextFields height?
FYI: I tested some ways like putting the textField in a view ...et cetera. non of them works.
Changing the font size changes the height!
I create a contact form and therefore I use a UITextView in my storyboard but when I launch the application, my UITextView is not displayed ...: /
Someone would have the solution to this bug? The only tool I can give you is a screenshot because there is almost no code.
Thank you in advance for your help ! And especially Happy New Year everyone!
Explications
Your UITextView doesn’t know its height.
You have to set its bottom constraint or height constraint (in this case bottom constraint equal to Emvoyer button’s top constraint seems correct).
I was looking at this post on increasing the height size of textfield. However, I have an issue when I have the height of 40, I get this
This can be solved by increasing the font size, but how do I keep the font size the same?
Show this screenshot and try it
You just need to clear your text property and only need to give placeholder text.
You don't need to worry just run your code and check on device or simulator your input text will be looking fine.
Hope it helps you.
As #Inder Kumar Rathore, and #Saheb Roy pointed out that it's a bug in xcode. When you run it, it is just fine.
Depending on the height of the screen, I would like to adjust the height of a button in a view. What is the easiest way to do this in Swift?
I tried it in this way and also with CGRectMake() but nothing changed:
self.myButton.frame.size.height = self.myButton.frame.size.height*scrOpt
How can I "update" the frame?
The reason why you see no changes may be because you're using AutoLayout, and the button has some constraints applied to it, and you need to change the height constraint to accomplish what you want.
Edited: Changing frame properties directly seems to be possible in Swift but was not possible in Objective C.
If you are using auto layout, you need to update its height constraint, else update its frame
NSLog(#"%#",NSStringFromCGRect(self.myButton.frame));
NSLog(#"%f",scrOpt);
self.myButton.frame = CGRectMake(self.myButton.frame.origin.x, self.myButton.frame.origin.y, self.myButton.frame.size.width, self.myButton.frame.size.height*scrOpt)
NSLog(#"%#",NSStringFromCGRect(self.myButton.frame));
Edited check this and see what is Print NSLog
Please see the attached pictures. When I make a UITableViewCell in a storyboard and I select "detail right" as the cell's style, the label and text label are not visible.
I found that this is because Xcode is setting their font sizes to 0! While I can increase the size, I cannot change the labels' frames, which are also set to strangely small values, and so the text is truncated.
This problem does not appear with the other cell styles. The Xcode version is 5.0.2.
What is wrong here and how to I fix it?
I had the same issue earlier today. I fixed it by changing the font size from 0.0 to 17.0. I hope this helps.
This bug has resolved itself. The cause remains unknown.