IllegalArgumentException: radius must be > 0

前端 未结 3 1548
既然无缘
既然无缘 2021-02-19 04:12

I\'m designing a bar graph and a pie chart in a view pager using AChartEngine library. When I scroll from bar graph to pie chart, application crashes. The crash report is as fol

3条回答
  •  醉话见心
    2021-02-19 04:46

    If you are having this issue on Android L (5.0), I have noticed that GradientDrawable does not accept the "%" suffix. So instead, I have used the "%p" suffix, and it works. Also, I needed to change my absurdly high value (80000%) with a normal value (80%p), and now it looks proper.

    So, I have created a "drawable-v21" folder (from which Android L will take its drawables), copied my shape xml which contains the gradient and changed this line:

    android:gradientRadius="80000%"
    

    with this

    android:gradientRadius="80%p"
    

提交回复
热议问题