iOS 简单的提示框AlertView

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

iOS 简单的提示框AlertView_第1张图片

- (void)viewDidLoad {

[superviewDidLoad];

self.passwordView= [[passwordviewalloc]init];

//确定按钮的点击

[self.passwordView.sureBtnaddTarget:selfaction:@selector(sureAction)forControlEvents:UIControlEventTouchUpInside];

}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent*)event

{

[self.passwordViewshow];

}

下载地址

喜欢的拿去用吧

你可能感兴趣的:(iOS 简单的提示框AlertView)