自定义alerView
<h1>样式展示</h1>
<p><img src="https://www.showdoc.cc/server/api/common/visitfile/sign/25171d8a5b80afb47c05cc1f41f3f60c?showdoc=.jpg" alt="" /></p>
<h1>控件代码参数说明</h1>
<h1>代码引用</h1>
<pre><code>#import "HSW_CompletionCertificationMesView.h"</code></pre>
<pre><code> HSW_CompletionCertificationMesView*alerView = [[HSW_CompletionCertificationMesView alloc]initWithFrame:CGRectMake(0, 0, CRWidth, CRHeight)];
alerView.contentLabel.text = @"退出驾驶证认证?";
alerView.viewHeightLayoutConstraint.constant = 150;
alerView.topToTitleLabelLayoutConstraint.constant = 25;
alerView.contentLabel.textAlignment = NSTextAlignmentCenter;
alerView.myTitleLabel.text = @"";
[alerView.goToCertificationButton setTitle:@"退出" forState:UIControlStateNormal];
[alerView.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
[self.navigationController.view addSubview:alerView];
alerView.buttonActionBlock = ^(NSInteger sureOrCancle) {
}</code></pre>
<h1>代码使用样例</h1>
<pre><code> HSW_CompletionCertificationMesView*alerView = [[HSW_CompletionCertificationMesView alloc]initWithFrame:CGRectMake(0, 0, CRWidth, CRHeight)];
alerView.contentLabel.text = @"退出驾驶证认证?";
alerView.viewHeightLayoutConstraint.constant = 150;
alerView.topToTitleLabelLayoutConstraint.constant = 25;
alerView.contentLabel.textAlignment = NSTextAlignmentCenter;
alerView.myTitleLabel.text = @"";
[alerView.goToCertificationButton setTitle:@"退出" forState:UIControlStateNormal];
[alerView.cancelButton setTitle:@"取消" forState:UIControlStateNormal];
[self.navigationController.view addSubview:alerView];
alerView.buttonActionBlock = ^(NSInteger sureOrCancle) {
if (sureOrCancle == 0) {
}else{
if (weakSelf.navigationController.presentingViewController && weakSelf.navigationController.viewControllers.count == 1)
{
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}
else
{
[weakSelf.navigationController popViewControllerAnimated:YES];
}
}
};
}else{
if (self.navigationController.presentingViewController && self.navigationController.viewControllers.count == 1)
{
[self dismissViewControllerAnimated:YES completion:nil];
}
else
{
[self.navigationController popViewControllerAnimated:YES];
}
}
</code></pre>