The example of this article for everyone to share the iOS click on the text button to change the effect of circular loading code, for your reference, the specific contents are as follows
Implementation effect:
Implementation code:
/ARC-(void) drawhalfcircle {loadinglayer = [self drawcircle];
This is used to specify the start and end point of the brush loadinglayer.strokestart = 0.0;
Loadinglayer.strokeend = 0.75;
}-(Cashapelayer *) drawcircle {CGRect frame = CGRectMake (0, 0, self.frame.size.height, self.frame.size.height);
Cashapelayer *circlelayer = [Cashapelayer layer];
Specify frame, just to set width and height circlelayer.frame = frame;
Set Center Display circlelayer.position = Cgpointmake (SELF.FRAME.SIZE.HEIGHT/2, SELF.FRAME.SIZE.HEIGHT/2); Sets the fill color circlelayer.fillcolor = [Uicolor Clearcolor].
Cgcolor;
Set line width circlelayer.linewidth = 1;
Set the color of the line circlelayer.strokecolor = Kselfbordercolor.cgcolor;
Create a path using Uibezierpath uibezierpath *circlepath = [Uibezierpath bezierpathwithovalinrect:frame];
Set Cashapelayer and Uibezierpath association circlelayer.path = Circlepath.cgpath;
The Cashaperlayer is placed on a layer to display [Self.layer Addsublayer:circlelayer];
return circlelayer; }
The above is the entire content of this article, I hope to help you learn.