美文网首页iOS Developer
iOS 简单的提示框AlertView

iOS 简单的提示框AlertView

作者: Nbm | 来源:发表于2017-01-06 11:04 被阅读128次

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];

}

下载地址

喜欢的拿去用吧

相关文章

网友评论

    本文标题:iOS 简单的提示框AlertView

    本文链接:https://www.haomeiwen.com/subject/avvhettx.html