美文网首页
iOS13 UITextField 设置leftView大小不生

iOS13 UITextField 设置leftView大小不生

作者: Lee坚武 | 来源:发表于2020-01-06 17:28 被阅读0次
    _account = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, inputW, inputH)];
        _account.center = CGPointMake(SDKWindowW/2, self.logoView.frame.origin.y + self.logoView.frame.size.height);
        [_account setBackground:[UIImage imageNamed:XHIMG_INPUTBG]];
        UIView *accountView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, inputH, inputH)];
        UIImageView *accountLView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:XHIMG_ICON_PHONE]];
        accountLView.frame = CGRectMake(0, 0, inputH, inputH);
        [accountView addSubview:accountLView];
        _account.leftView = accountView;
        _account.leftViewMode = UITextFieldViewModeAlways;
        _account.placeholder = @"请输入手机号";
        _account.autocapitalizationType = UITextAutocapitalizationTypeNone;
        _account.font = fontNormal;
        _account.delegate = self;
        [self.view addSubview:_account];
    

    相关文章

      网友评论

          本文标题:iOS13 UITextField 设置leftView大小不生

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