How to access CALayer of individual bar in core-pl

2019-08-11 11:06发布

I am trying to perform an animation on each bar in the chart, however I am not quite sure how to access the calayer of each individual bar.

2条回答
We Are One
2楼-- · 2019-08-11 11:34

There isn't one. All of the bars are drawn in one layer. If you need to animate them individually, make a separate CPTBarPlot (a subclass of CALayer) for each bar.

查看更多
走好不送
3楼-- · 2019-08-11 11:37

I have another approach to this considering any performance issues you may face in future if your bars increases. You have a temporary CPTBarPlot with only one bar, to be used just for animation purpose. Use it to perform any animation and remove/hide it once you are done with animation.

查看更多
登录 后发表回答