cocoa touch - How to reuse CALayer -


i want use cagradientlayer each of cell backgrounds in custom table scroll view. if allocate cagradientlayer each cell, scrolling slow, somehow reuse gradient each cell, sort of how can reuse uiimage in uiimageview. such thing possible?

gradient = [cagradientlayer new];         gradient.frame = innerview.bounds;         gradient.colors = [nsarray arraywithobjects:(id)topcolor.cgcolor, (id)bottomcolor.cgcolor, nil];         //gradient.shouldrasterize = yes;     [innerview.layer insertsublayer:gradient atindex:0]; 

i realized render gradient (renderincontext:) context using uigraphicsbeginimagecontext() , reuse image obtained it.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -