iOS开发过程中难免会遇到各种自定义的视图和界面,原生系统不可能提供所有的雷同界面,就算键盘样式有8种,也满足不了产品各种变态的需求,今天提供一种输入时身份证专属键盘,讲白了就是自定义一个带x 的键盘,网上也有各种大神写的sdk,但是总感觉麻烦,废话免谈,都是程序猿,且看如下代码:
1、引用DefineIdentityKeyboardView文件内容(就一个文件,包含.h和.m)
/***.h内容如下***/
#import <UIKit/UIKit.h>
@interface DefineIdentityKeyboardViewCell : UICollectionViewCell
@end
@interface DefineIdentityKeyboardView : UIView
@end
/***.m内容如下***/
#import “DefineIdentityKeyboardView.h”
@interface DefineIdentityKeyboardViewCell()
@property(nonatomic,strong)UIButton *titleBtn;
@property(nonatomic,strong)UIImageView *bottomImg;
@property(nonatomic,strong)UIImageView *rightImg;
@end
@implementation DefineIdentityKeyboardViewCell
-(id)initWithFrame:(CGRect)frame
{
self=[super initWithFrame:fra