CAShapeLayer*maskLayer = [CAShapeLayerlayer]; maskLayer.path = [UIBezierPathbezierPathWithRoundedRect:view.bounds byRoundingCorners:UIRectCornerBottomLeft|UIRectCornerBottomRightcornerRadii: (CGSize){5.0f,5.0f}].CGPath view.layer.masksToBounds =YES; view.layer.mask = maskLayer;
UIRectCorner有五种
UIRectCornerTopLeft //上左
UIRectCornerTopRight //上右
UIRectCornerBottomLeft // 下左
UIRectCornerBottomRight // 下右
UIRectCornerAllCorners // 全部
网友评论