简易展示代码
@property(nonatomic,strong) TKRoundedView * topView;
@property(nonatomic,strong) UIView * bottomView;
-(TKRoundedView *)topView
{
if(_topView == nil)
{
_topView = [[TKRoundedView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.titleLab.frame), kpadding, rightHei, 36)];
_topView.roundedCorners = TKRoundedCornerTopLeft | TKRoundedCornerTopRight;
_topView.borderWidth = 0.5;
_topView.borderColor = Red_Color;
_topView.fillColor = [UIColor whiteColor];
_topView.cornerRadius = 5.0f;
}
return _topView;
}
-(UIView *)bottomView
{
if(_bottomView == nil)
{
_bottomView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.titleLab.frame), CGRectGetMaxY(self.topView.frame), rightHei, 18)];
UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:_bottomView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer * maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = _bottomView.bounds;
maskLayer.path = maskPath.CGPath;
_bottomView.layer.mask = maskLayer;
_bottomView.backgroundColor = Red_Color;
}
return _bottomView;
}
效果图