如何设置 UITextField 文本自定义位置和输入新行?

How to set UITextField text custom position and enter new line?

我有一个 TextField 尺寸 350 X 93 并且我已经将 TextFieldcontrol 设置为垂直向上。但我有一个问题,即文本在顶部过多,看起来很奇怪。如何以编程方式将该文本设置为向下 10 像素? "Comment in the picture"

还有一个问题,如何设置文本超过100个字符后换行?因为在 TextField 框到达末尾后不会换行

解决第二个问题,多行输入使用UITextView instead of UITextFieldtextContainerInset 属性 可能会有用。请注意,UITextView 无法显示占位符文本。