手机验证码登录

This commit is contained in:
冯硕
2021-09-08 21:29:47 +08:00
committed by fengshuo
parent dddf7cb014
commit dd3c8b3453
15 changed files with 747 additions and 3 deletions

View File

@@ -0,0 +1,96 @@
//
// LoginInputView.m
// xplan-ios
//
// Created by on 2021/9/8.
//
#import "LoginInputView.h"
///
#import <Masonry/Masonry.h>
///
@interface LoginInputView ()
///
@property (nonatomic,strong) UIStackView *stackView;
///
@property (nonatomic,strong) UILabel *titleLabel;
///
@property (nonatomic,strong) UITextField *textField;
@end
@implementation LoginInputView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];
[self.stackView addArrangedSubview:self.titleLabel];
[self.stackView addArrangedSubview:self.textField];
}
- (void)initSubViewConstraints {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(50);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.right.top.bottom.mas_equalTo(self);
}];
}
#pragma mark - Getters And Setters
- (void)setPlaceHolder:(NSString *)placeHolder {
_placeHolder = placeHolder;
if (_placeHolder) {
self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:_placeHolder attributes:@{NSForegroundColorAttributeName: ThemeTextColor, NSFontAttributeName:[UIFont systemFontOfSize:14]}];
}
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 0;
}
return _stackView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:18];
_titleLabel.textColor = [UIColor whiteColor];
_titleLabel.text = @"+86";
}
return _titleLabel;
}
- (UITextField *)textField {
if (!_textField) {
_textField = [[UITextField alloc] init];
_textField.textColor = [UIColor whiteColor];
_textField.font = [UIFont systemFontOfSize:18.f];
_textField.borderStyle = UITextBorderStyleNone;
_textField.keyboardType = UIKeyboardTypeNumberPad;
_textField.tintColor = ThemeBackgroundColor;
_textField.backgroundColor = [UIColor redColor];
}
return _textField;
}
@end