recordBottomView.m 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // recordBottomView.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2025/3/28.
  6. //
  7. #import "recordBottomView.h"
  8. @implementation recordBottomView
  9. - (id)initWithFrame:(CGRect)frame{
  10. self = [super initWithFrame:frame];
  11. self.backgroundColor = [UIColor whiteColor];
  12. [self drawAnyView];
  13. return self;
  14. }
  15. -(void)drawAnyView{
  16. /*上圆角*/
  17. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W, 100 + AdaptTabHeight)
  18. byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
  19. cornerRadii:CGSizeMake(12, 12)];
  20. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  21. maskLayer.frame = CGRectMake(0, 0, SCREEN_W, 100 + AdaptTabHeight);
  22. maskLayer.path = maskPath.CGPath;
  23. self.layer.mask = maskLayer;
  24. UIButton *recordBut = [[UIButton alloc] init];
  25. [recordBut setBackgroundImage:[UIImage imageNamed:@"white_record_icon"] forState:UIControlStateNormal];
  26. [recordBut addTarget:self action:@selector(didClickButFun) forControlEvents:UIControlEventTouchUpInside];
  27. [self addSubview:recordBut];
  28. [recordBut mas_makeConstraints:^(MASConstraintMaker *make) {
  29. make.width.mas_equalTo(78.f);
  30. make.height.mas_equalTo(78.f);
  31. make.centerX.mas_equalTo(0.f);
  32. make.centerY.mas_equalTo(0.f);
  33. }];
  34. }
  35. - (void)didClickButFun
  36. {
  37. if (_didClickRecordFun) {
  38. _didClickRecordFun();
  39. }
  40. }
  41. @end