iOS UITextField 内边距
override func textRect(forBounds bounds: CGRect) -> CGRect {
// top left
CGRect(x: bounds.minX, y: bounds.minY, width: bounds.width / 2, height: bounds.height / 2)
}
override func placeholderRect(forBounds bounds: CGRect) -> CGRect {
// top right
CGRect(x: bounds.midX, y: bounds.minY, width: bounds.width / 2, height: bounds.height / 2)
}
override func borderRect(forBounds bounds: CGRect) -> CGRect {
// bottom left
CGRect(x: bounds.minX, y: bounds.midY, width: bounds.width / 2, height: bounds.height / 2)
}
override func editingRect(forBounds bounds: CGRect) -> CGRect {
// bottom right
CGRect(x: bounds.midX, y: bounds.midY, width: bounds.width / 2, height: bounds.height / 2)
}