YOUPAILZLiveVideoView.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // YOUPAILZLiveVideoView.m
  3. // TIANYAN
  4. //
  5. // Created by CY on 2021/5/31.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZLiveVideoView.h"
  9. @interface YOUPAILZLiveVideoView ()
  10. @property (nonatomic,weak) UIView *youpaipofflineBgV;
  11. @property (nonatomic,weak) UILabel *youpaipofflineTitleL;
  12. @property (nonatomic,weak) UILabel *youpaipofflineSubTitleL;
  13. @end
  14. @implementation YOUPAILZLiveVideoView
  15. - (instancetype)initWithFrame:(CGRect)frame{
  16. if (self = [super initWithFrame:frame]) {
  17. [self youpaifinitUI];
  18. }
  19. return self;
  20. }
  21. - (void)youpaifinitUI{
  22. UIView *videoView= [[UIView alloc] init];
  23. [self addSubview:videoView];
  24. self.youpaipvideoView = videoView;
  25. [videoView mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.top.bottom.right.offset(0.0f);
  27. }];
  28. UIView *youpaipofflineBgV = [[UIView alloc] init];
  29. youpaipofflineBgV.hidden = YES;
  30. youpaipofflineBgV.backgroundColor = HexColorFromRGB(0x2A2935);
  31. [self addSubview:youpaipofflineBgV];
  32. self.youpaipofflineBgV = youpaipofflineBgV;
  33. [youpaipofflineBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.left.top.bottom.right.offset(0.0f);
  35. }];
  36. UILabel *youpaipofflineTitleL = [[UILabel alloc] init];
  37. youpaipofflineTitleL.text = @"女神暂时离开";
  38. youpaipofflineTitleL.font = LCFont16;
  39. youpaipofflineTitleL.textColor = HexColorFromRGB(0x9F9DA5);
  40. youpaipofflineTitleL.textAlignment = NSTextAlignmentCenter;
  41. [youpaipofflineBgV addSubview:youpaipofflineTitleL];
  42. self.youpaipofflineTitleL = youpaipofflineTitleL;
  43. [youpaipofflineTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  44. make.left.offset(8.0f);
  45. make.right.offset(-8.0f);
  46. make.bottom.equalTo(youpaipofflineBgV.mas_centerY).offset(-3.0f);
  47. }];
  48. UILabel *youpaipofflineSubTitleL = [[UILabel alloc] init];
  49. youpaipofflineSubTitleL.text = @"休息片刻,马上回来";
  50. youpaipofflineSubTitleL.font = LCFont14;
  51. youpaipofflineSubTitleL.textColor = HexColorFromRGB(0x9F9DA5);
  52. youpaipofflineSubTitleL.textAlignment = NSTextAlignmentCenter;
  53. [youpaipofflineBgV addSubview:youpaipofflineSubTitleL];
  54. self.youpaipofflineSubTitleL = youpaipofflineSubTitleL;
  55. [youpaipofflineSubTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.left.offset(8.0f);
  57. make.right.offset(-8.0f);
  58. make.top.equalTo(youpaipofflineBgV.mas_centerY).offset(3.0f);
  59. }];
  60. }
  61. - (void)setYoupaipisOff:(BOOL)youpaipisOff{
  62. _youpaipisOff = youpaipisOff;
  63. self.youpaipofflineBgV.hidden = !youpaipisOff;
  64. }
  65. @end