ZKFaceVerifyMsgView.m 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. //
  2. // ZKFaceVerifyMsgView.m
  3. // JianYuIOS
  4. //
  5. // Created by apple on 2020/8/13.
  6. // Copyright © 2020 lixianglan. All rights reserved.
  7. //
  8. #import "ZKFaceVerifyMsgView.h"
  9. #import "ZKModal.h"
  10. @interface ZKFaceVerifyMsgView()
  11. @property (nonatomic,strong)UILabel *titleLabel;
  12. @property (nonatomic,strong)UILabel *descLabel;
  13. @end
  14. @implementation ZKFaceVerifyMsgView
  15. -(instancetype)initWithFrame:(CGRect)frame
  16. {
  17. if (self = [super initWithFrame:frame]) {
  18. self.backgroundColor = [UIColor whiteColor];
  19. self.layer.masksToBounds = YES;
  20. self.layer.cornerRadius = 10;
  21. CGFloat B_H = 50;
  22. UIButton *button = [ZKControl createButtonWithFrame:CGRectMake(0, self.height-B_H, self.width, B_H) title:@"知道了" titleColor:UIColorFromRGB(0x795441) titleFont:15 imageName:nil bgImageName:nil target:self method:@selector(doneClick)];
  23. UIView *lineView = [ZKControl createViewWithFrame:CGRectMake(0, self.height-B_H-1, self.width, 1) color:UIColorFromRGB(0xEEEEEE)];
  24. [self addSubview:button];
  25. [self addSubview:lineView];
  26. UILabel *titleLabel = [ZKControl createLabelWithFrame:CGRectMake(0, 0, self.width, 40) font:15 text:@"" TextAlignment:NSTextAlignmentCenter TextColor:UIColorFromRGB(0x000000) bgColor:nil];
  27. [self addSubview:titleLabel];
  28. self.titleLabel = titleLabel;
  29. UILabel *descLabel = [ZKControl createLabelWithFrame:CGRectMake(15, titleLabel.bottom, self.width-30, lineView.top-titleLabel.bottom) font:15 text:@"" TextAlignment:NSTextAlignmentCenter TextColor:UIColorFromRGB(0x000000) bgColor:nil];
  30. descLabel.alpha = 0.5;
  31. descLabel.numberOfLines = 0;
  32. [self addSubview:descLabel];
  33. self.descLabel = descLabel;
  34. }
  35. return self;
  36. }
  37. -(void)doneClick
  38. {
  39. [[ZKModal sharedInstance] hide];
  40. }
  41. -(void)show
  42. {
  43. [[ZKModal sharedInstance] showWithContentView:self andAnimated:YES];
  44. }
  45. -(void)dismiss
  46. {
  47. [[ZKModal sharedInstance] hide];
  48. }
  49. -(void)setTitleName:(NSString *)titleName
  50. {
  51. _titleName = titleName;
  52. self.titleLabel.text = _titleName;
  53. }
  54. -(void)setDescTitle:(NSString *)descTitle
  55. {
  56. _descTitle = descTitle;
  57. self.descLabel.text = _descTitle;
  58. self.descLabel.attributedText = [ZKMethod getAttributedStringWithString:self.descLabel.text lineSpace:5 with:Center];
  59. }
  60. /*
  61. // Only override drawRect: if you perform custom drawing.
  62. // An empty implementation adversely affects performance during animation.
  63. - (void)drawRect:(CGRect)rect {
  64. // Drawing code
  65. }
  66. */
  67. @end