What is the height of uitextfield in xcode (iphone)

square view ... (not rounded)

I am trying to make a background that fits my texfield and cannot find the height (default) somewhere

+6
source share
3 answers

The default height is 31pts (you can see this in IB), but it is fixed only for the rounded border style - with all other styles you can set the height of the field to an arbitrary value.

btw, you can find the link for common user interface elements here

+15
source
[textField sizeThatFits:textField.frame.size].height 

If you have complex 31pts code then you will have unsightly visual errors if (when) Apple ever resizes.

+1
source

UITextField is a subclass of UIView, so you can send -frame or -bounds to an object.

0
source

Source: https://habr.com/ru/post/885655/


All Articles