Skip to content

cuixinkuan/PasswordText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PasswordText

☆☆☆ “好用的密码键盘” ☆☆☆

使用简单,两步就搞定啦,可以根据自己的需求修改和扩展。

(1)导入CCPasswordText文件夹(只有两个文件哦)

(2)引入头文件(#import "CCPasswordTextView.h")

示例代码

CCPasswordTextView * pwView = [[CCPasswordTextView alloc] initWithFrame:CGRectMake(0, 0, element_wh * count, element_wh)];

pwView.center = CGPointMake(self.view.center.x, 140);

pwView.elementCount = count; // 元素位数

pwView.elementBorderColor = [UIColor lightGrayColor];// 边界线颜色

pwView.elementBorderWidth = 1; // 边界线宽度

pwView.elementMargin = 0;// 元素间间距

[pwView setValidationBoardType:VALIDATION_BOARDTYPE_NUMBER]; // 键盘样式

pwView.passwordDidChangeBlock = ^(NSString * password) {

NSLog(@"----------> password:%@",password);

};

[self.view addSubview:pwView];

PS:如需更详细的设置,进入CCPasswordTextView.m,写的有注释。

简单效果如下图

About

好用的密码键盘

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published