12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // KDPRecommendHeadView.m
- // KuDianProject
- //
- // Created by 学丽 on 2019/7/4.
- // Copyright © 2019 KDP. All rights reserved.
- //
- #import "KDPRecommendHeadView.h"
- @implementation KDPRecommendHeadView
- -(instancetype)initWithFrame:(CGRect)frame
- {
- self =[super initWithFrame:frame];
- if (self) {
-
- UIImageView *backV=[[UIImageView alloc]initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH-20, 56)];
- backV.backgroundColor=[UIColor whiteColor];
- UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:backV.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(6, 6)];
- CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
- maskLayer.frame = backV.bounds;
- maskLayer.path = maskPath.CGPath;
- backV.layer.mask = maskLayer;
- backV.layer.masksToBounds=YES;
- [self addSubview:backV];
-
-
- UIImageView *bannerImg=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 150, 35)];
- bannerImg.center=backV.center;
- bannerImg.image=[UIImage imageNamed:@"recommend_icon"];
- [backV addSubview:bannerImg];
-
-
-
-
- }
- return self;
- }
- @end
|