2016.7.27
CAShapeLayer*border = [CAShapeLayerlayer];
border.strokeColor= [UIColorhexStringToColor:@"#cccccc"].CGColor;
border.fillColor=nil;
border.path= [UIBezierPathbezierPathWithRect:self.frontBtn.bounds].CGPath;
border.frame=self.frontBtn.bounds;
border.lineWidth=1.f;
border.lineCap=@"square";
border.lineDashPattern=@[@2,@2];//虚线的长和间距
[self.frontBtn.layeraddSublayer:border];