UITableView layer shadow performance optimisation? -
i have got uitableview
cells include layer shadow , subviews too. summed have 5 shadows per cell. reuse cells change height when content exceeds height (i because cause more draw calls 'optimisations' enlist below).
now, have added following optimisations:
// setting opaque tell gpu not blend // layer (-> less draw calls - useful when layer opaque obviously) myshadowview.opaque = yes; // significant factor shadowpath property, // smoothed scrolling myshadowview.layer.shadowoffset = cgsizemake(0, -1); myshadowview.layer.shadowopacity = 0.08; myshadowview.layer.shadowradius = 1; myshadowview.layer.shadowpath = [uibezierpath bezierpathwithrect:shad.bounds].cgpath; // important change myshadowview.layer.shouldrasterize = yes; myshadowview.layer.rasterizationscale = [uiscreen mainscreen].scale;
i very happy performance -- scrolling smooth baby skin -- shouldrasterize
property comes drawbacks. when scroll down, takes cell little while load bitmap. there way pre-render cells ? table without reuse identifier rid of problem ?
i absolutely need shadows, not sacrifice performance them. hope someody can help.
Comments
Post a Comment