美文网首页
UITextField 设置文字与边框距离

UITextField 设置文字与边框距离

作者: 夜未殇 | 来源:发表于2017-04-26 15:48 被阅读0次
    -(void)setTextFieldLeftPadding:(UITextField *)textField forWidth:(CGFloat)leftWidth
    {
        CGRect frame = textField.frame;
        frame.size.width = leftWidth;
        UIView *leftview = [[UIView alloc] initWithFrame:frame];
        textField.leftViewMode = UITextFieldViewModeAlways;
        textField.leftView = leftview;
    }
    
    

    相关文章

      网友评论

          本文标题:UITextField 设置文字与边框距离

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