1.自定义的提示框
#import
@interfacepasswordview :UIView
/**输入密码的view */
@property(nonatomic,strong)UIView*passwordView;
/**显示钱数的label */
@property(nonatomic,strong)UILabel*moneyLabel;
/**输入框*/
@property(nonatomic,strong)UITextField*passwordField;
/**确定按钮*/
@property(nonatomic,strong)UIButton*sureBtn;
- (void)show; // 显示界面
- (void)dismiss; // 隐藏界面
@end
在控制器中直接点击触发事件
#import"ViewController.h"
#import"passwordview.h"
@interfaceViewController()
/** AlertView */
@property(nonatomic,strong)passwordview*passwordView;
@end
@implementationViewController
- (void)viewDidLoad {
[superviewDidLoad];
self.passwordView= [[passwordviewalloc]init];
//确定按钮的点击
[self.passwordView.sureBtnaddTarget:selfaction:@selector(sureAction)forControlEvents:UIControlEventTouchUpInside];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event
{
[self.passwordViewshow];
}
喜欢的拿去用吧