Swift

[Swift] UITextField Set Padding

hyeonii_12 2020. 4. 16. 18:16
반응형

let leftPadding = UIView(frame: CGRect(x: 0, y: 0, width: 15, height: self.inputTextField.frame.height)) inputTextField.leftView = leftPadding
inputTextField.leftViewMode = UITextField.ViewMode.always

let rightPadding = UIView(frame: CGRect(x: 0, y: 0, width: inputButton.frame.width + 10, height: self.inputTextField.frame.height))
inputTextField.rightView = rightPadding
inputTextField.rightViewMode = UITextField.ViewMode.always
반응형