简体   繁体   中英

UICollectionView scroll lags with core plot

I'm using a UICollectionView on my iPad 3 to display a dashboard of BarChart using CorePlot. I have around 3 pages of 6 BarChart.

When user scrolls the UICollectionView there're some lags.

I have changed the theme of my BarChart from kCPTDarkGradientTheme to kCPTPlainBlackTheme and the scroll is much better but it still lags a little.

From instrument it seems it takes some times (160ms) in -(void)recursivelyRenderInContext:(CGContextRef)context from CPTLayer.

Any idea how to improve it? Regards,

Sébastien.

Solid colors render a lot faster than gradients, so that explains the improvement when you changed themes. Are you caching the generated graph images so they only have to render once? The iOS version of the Plot Gallery example app use a table view to show the graph thumbnails, but it might give you some ideas how to structure your app for better performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM