Chart using scrollview in Android
I want to draw a chart and I'm using a scrollview to do so. my scrollview holds the chart view. What I've observed is that the scrollview's onDraw calls the onDraw of my chart view. Now I draw the entire chart on the canvas when the onDraw of chart view is called. Also scrollview's onDraw is called everytime I scroll 开发者_StackOverflowthe view. So I end up drawing the entire chart multiple times. Is there any better way to achieve what this
Check out the View.getDrawingRect(rect) method. This will give you the scrolled area to draw, so you can draw just the parts that fall into this area.
精彩评论