0

I want to put the text in another position but I don't know how to do that? , There is no option to fix this issue on the Attributes Inspector?

See the | needs to be right where the arrow is pointing out:

enter image description here

2
  • You need to either give spaceing in Text or customised Textfield. Commented Feb 23, 2022 at 15:56
  • Probably you can use this Commented Feb 23, 2022 at 16:01

1 Answer 1

4

You can make a custom padded TextField. You could try something like this

class PaddedTextFeild: UITextField { let padding = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 5) override open func textRect(forBounds bounds: CGRect) -> CGRect { return bounds.inset(by: padding) } override open func placeholderRect(forBounds bounds: CGRect) -> CGRect { return bounds.inset(by: padding) } override open func editingRect(forBounds bounds: CGRect) -> CGRect { return bounds.inset(by: padding) } } 

You could try using this class as it is. And change the UIEdgeInsets defined in the first line.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.