美文网首页
ios view顶部圆角

ios view顶部圆角

作者: 米开朗骑騾 | 来源:发表于2019-07-05 14:46 被阅读0次
    -(UIView *)platFormBGV{
    
    if (!_platFormBGV) {
    
    _platFormBGV = [[UIView alloc] init];
    
    _platFormBGV.backgroundColor = [UIColor whiteColor];
    
    _platFormBGV.frame = CGRectMake(0, self.view.frame.size.height, APP_WIDTH, 220);
    
    // 左上和右上为圆角
    
    UIBezierPath *cornerRadiusPath = [UIBezierPath bezierPathWithRoundedRect:_platFormBGV.bounds byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft cornerRadii:CGSizeMake(16, 16)];
    
    CAShapeLayer *cornerRadiusLayer = [ [CAShapeLayer alloc ] init];
    
    cornerRadiusLayer.frame = _platFormBGV.bounds;
    
    cornerRadiusLayer.path = cornerRadiusPath.CGPath; _platFormBGV.layer.mask = cornerRadiusLayer; } return _platFormBGV;
    
    }
    

    相关文章

      网友评论

          本文标题:ios view顶部圆角

          本文链接:https://www.haomeiwen.com/subject/fvcehctx.html