實(shí)現(xiàn)效果
透明.jpg
代碼
_keyTextField.layer.borderWidth = 1.5f;//邊框大小
_keyTextField.layer.cornerRadius = 5;//邊框圓角大小
[_keyTextField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];//設(shè)置占位字的顏色
[_keyTextField setBackgroundColor:[UIColor clearColor]];//透明效果
_keyTextField.layer.borderColor = [UIColor whiteColor].CGColor;//邊框顏色