ios - CALayer mask slows down view transitions iPhone 4 -


im using cashapelayer mask animate drawing of circular progress bar:

cgmutablepathref path = cgpathcreatemutable(); cgpathaddarc(path, nil, 99.65, 99.25, 84, radians(startangle), radians(endangle), 0);  cashapelayer *layer = [cashapelayer layer]; layer.path = path; layer.strokecolor = [uicolor redcolor].cgcolor; layer.linewidth = 21; layer.linecap = kcalinecapround; layer.linejoin = kcalinejoinround; layer.fillcolor = [uicolor clearcolor].cgcolor;  _progressbar.layer.mask = layer;  // configure animation cabasicanimation *drawanimation = [cabasicanimation animationwithkeypath:@"strokeend"]; drawanimation.duration            = animation_duration; drawanimation.repeatcount         = 1.0; drawanimation.removedoncompletion = yes; drawanimation.fromvalue = [nsnumber numberwithfloat:0.0f]; drawanimation.tovalue   = [nsnumber numberwithfloat:1]; [layer addanimation:drawanimation forkey:@"drawcircleanimation"]; 

the animation works great, circular progress bar goes empty full smoothly. problem when transition view once progress animation has completed. when next view slides in, or view slides in view segue transition animation choppy.

i have narrowed problem down mask '_progressbar.layer.mask = layer;'. when remove transitions smooth again.

setting layer.shouldrasterize = yes on mask or image layer doesn't seem help.

i'm not sure how optimise segue transitions smooth. test device iphone 4.

update tested on iphone 3gs: smoother not perfect, better 4! tested on iphone 5: smooth off course, phone fast.

iphone 4 seems have problems mask operations if knows of workaround love hear it.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -