
bView.layer.cornerRadius = 4
CAShapeLayer*borderLayer = [[CAShapeLayeralloc]init]
borderLayer.bounds= bView.bounds
borderLayer.position=CGPointMake(bView.centerX, bView.centerY)
borderLayer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0,0, 68, 68) cornerRadius:4].CGPath
borderLayer.lineWidth=1
borderLayer.lineDashPattern = @[@6,@4]//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase=0.1
borderLayer.fillColor=UIColor.clearColor.CGColor
borderLayer.strokeColor=BSHexColor(0xA6A8AB).CGColor
[bView.layeraddSublayer:borderLayer]
}
border-width:0 1px 例子 1 border-width:thin medium thick 10px上边框是细边框 右边框是中等边框 下边框是粗边框 左边框是 10px 宽的边框 例子 2 border-width:thin medium thick上边框是 10px 右边框和左边框是中等边框 下边框是粗边框 例子 3 border-width:thin medium上边框和下边框是细边框 右边框和左边框是中等边框 例子 4 border-width:thin所有 4 个边框都是细边框。1.shadow
(1)
第一个属性:设置阴影透明度。
(2)
第二个属性:设置超过Bounds以外的区域不切除
(如果你之前没有对UIView设置这个属性,那么默认时NO,不需要重新设置)
2.border
borderColor:边框颜色
borderWidth:边框宽度
3.Radius
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)