美文网首页
UITextField 设置输入文字的左间距

UITextField 设置输入文字的左间距

作者: CoderZb | 来源:发表于2020-07-01 08:40 被阅读0次
// 输入框
self.codeInputField.font = [UIFont systemFontOfSize:tRealFontSize(12)];
self.codeInputField.keyboardType = UIKeyboardTypeNumberPad;
[self.view addSubview:self.codeInputField];
// 输入框的左侧view
UIView *paddingLeftView = [[UIView alloc] init];
CGRect frame = self.codeInputField.frame;
frame.size.width = 12;
paddingLeftView.frame = frame;
self.codeInputField.leftViewMode = UITextFieldViewModeAlways;
self.codeInputField.leftView = paddingLeftView;

相关文章

网友评论

      本文标题:UITextField 设置输入文字的左间距

      本文链接:https://www.haomeiwen.com/subject/mbnrfktx.html