// // recordBottomView.m // 双子星云手机 // // Created by xd h on 2025/3/28. // #import "recordBottomView.h" @implementation recordBottomView - (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; self.backgroundColor = [UIColor whiteColor]; [self drawAnyView]; return self; } -(void)drawAnyView{ /*上圆角*/ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W, 100 + AdaptTabHeight) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)]; CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = CGRectMake(0, 0, SCREEN_W, 100 + AdaptTabHeight); maskLayer.path = maskPath.CGPath; self.layer.mask = maskLayer; UIButton *recordBut = [[UIButton alloc] init]; [recordBut setBackgroundImage:[UIImage imageNamed:@"white_record_icon"] forState:UIControlStateNormal]; [recordBut addTarget:self action:@selector(didClickButFun) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:recordBut]; [recordBut mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(78.f); make.height.mas_equalTo(78.f); make.centerX.mas_equalTo(0.f); make.centerY.mas_equalTo(0.f); }]; } - (void)didClickButFun { if (_didClickRecordFun) { _didClickRecordFun(); } } @end