Uibezierpath *apth = [Uibezierpath bezierpathwitharccenter:cgpointmake (65.F) radius:50.f startAngle:-M_PI_2 Endangle:m_pi_2 Clockwise:yes]; Apth.linewidth = 5.0f; Apth.linecapstyle = Kcglinecapround; Apth.linejoinstyle = Kcglinejoinround; [[Uicolor Redcolor] setstroke]; [[Uicolor Orangecolor] setfill]; [Apth stroke];
Progress bar Animation
First, uibezierpath draw segment
uibezierpath *circlepath = [ Span class= "S1" >uibezierpath bezierpathwitharccenter: cgpointmake (5565.fradius:50.f Startangle:-< span class= "S5" >m_pi_2 endangle :m_pi_2*3 clockwise:yes];
// second, Uibezierpath and cashapelayer associations
Cashapelayercashapelayerlayer];
Progresslayer. path cgpath ;
Progresslayer. FillColor = [uicolor clearcolor]. Cgcolor;
Progresslayer. strokecolor uicolorredcolorcgcolor ;
Progresslayer. linewidth = 5.0f;
Progresslayer. LineCap = kcalinecapround;
// third, animation
cabasicanimation *ani = [ cabasicanimation animationwithkeypath : nsstringfromselector ( @selector (strokeend))];
Ani. fromvalue = @0 ;
Tovalue@1 ;
Duration5 ;
Addanimationforkeynsstringfromselector@selector (strokeend))];
Layeraddsublayer :p rogresslayer];
IOS Bezier Round progress bar