BDFaceRemindView.m 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // RemindView.m
  3. // FaceSDKSample_IOS
  4. //
  5. // Created by Tong,Shasha on 2017/9/5.
  6. // Copyright © 2017年 Baidu. All rights reserved.
  7. //
  8. #import "BDFaceRemindView.h"
  9. #import "BDFaceImageUtils.h"
  10. @implementation BDFaceRemindView
  11. - (instancetype)initWithFrame:(CGRect)frame
  12. {
  13. self = [super initWithFrame:frame];
  14. if (self) {
  15. self.layer.borderWidth = 1.0;
  16. self.layer.borderColor = OutSideColor.CGColor;
  17. self.layer.cornerRadius = 17;
  18. UIImageView * remindImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, (frame.size.height-27)/2.0, 27, 27)];
  19. remindImage.image = [BDFaceImageUtils getImageResourceForName:@"warning"];
  20. [self addSubview:remindImage];
  21. UILabel * remindLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(remindImage.frame)+15, CGRectGetMinY(remindImage.frame), 120, CGRectGetHeight(remindImage.frame))];
  22. remindLabel.textColor = OutSideColor;
  23. remindLabel.font = [UIFont systemFontOfSize:22];
  24. remindLabel.text = @"请正对手机";
  25. [self addSubview:remindLabel];
  26. }
  27. return self;
  28. }
  29. /*
  30. // Only override drawRect: if you perform custom drawing.
  31. // An empty implementation adversely affects performance during animation.
  32. - (void)drawRect:(CGRect)rect {
  33. // Drawing code
  34. }
  35. */
  36. @end