自定义view
PassWordView.h
@interface PassWordView : UIView
@property (weak ,nonatomic)UILabel * alertLabel;
@property (weak ,nonatomic)UITextField * passWordFiled;
@property (weak ,nonatomic)UIImageView * inserImageView;
@end
PassWordView.m
@interface PassWordView ()
@end
@implementation PassWordView
-(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self createUI];
}
return self;
}
-(void)createUI
{
UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(0, 5, [UIScreen mainScreen].bounds.size.width, 20)];
label.text = @"请输入云理想支付密码";
label.textAlignment = NSTextAlignmentCenter;
label.font = [UIFont systemFontOfSize:[UIFont smallSystemFontSize]];
self.alertLabel = label;
[self addSubview:self.alertLabel];
// UIImageView * inserImageView = [[UIImageView alloc] initWithFrame:CGRectMake(30, 35, kScreen_Width-60, 60)];
UIImageView * inserImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 35, kScreen_Width-20, (kScreen_Width-20)/6)];
[inserImageView setImage:[UIImage imageNamed:@"bg_textF"]];
self.inserImageView = inserImageView;
[self addSubview:self.inserImageView];
for (int i = 0; i < 6; i ++) {
UIView * point = [[UIView alloc] init];
CGFloat x = ((kScreen_Width-20)/6/2-7.5) + (kScreen_Width-20)/6*i;
point.frame = CGRectMake(x, (kScreen_Width-20)/6/2 - 7.5, 15, 15);
point.layer.cornerRadius = 7.5;
point.layer.masksToBounds = YES;
point.tag = i + 1;
point.hidden = YES;
point.userInteractionEnabled = YES;
point.backgroundColor = [UIColor blackColor];
[inserImageView addSubview:point];
}
// UIButton * sureButton = [UIButton buttonWithType:UIButtonTypeCustom];
// sureButton.frame = CGRectMake(30, 120, kScreen_Width - 60, 40);
// sureButton.enabled = NO;
// [ButtonUtil setButtonSelectorWithNormalcolor:APP_BG AndHeighColor:SELECTOR_COLOR AndButton:sureButton];
// [sureButton setTitle:@"下一步" forState:UIControlStateNormal];
// [sureButton addTarget:self action:@selector(sureButtonClick) forControlEvents:UIControlEventTouchUpInside];
// self.sureButton = sureButton;
// [self addSubview:self.sureButton];
// 输入框
UITextField * textFiled = [[UITextField alloc] initWithFrame:CGRectMake(kScreen_Width +10, 30, 80, 30)];
textFiled.keyboardType = UIKeyboardTypeNumberPad;
[textFiled becomeFirstResponder];
self.passWordFiled = textFiled;
[self addSubview:textFiled];
}