MPAndroidChart如何在Fragment中使用

版权声明:转载请注明出处http://blog.csdn.net/xuaho0907 https://blog.csdn.net/xuaho0907/article/details/78248307

直接把DemoBase中的代码考到Fragment中去,不用管DemoBase的继承关系

然后再把你想要的图标的Activity(如,饼图)考到Fragment中

需要注意的是:

1.MPAndroidChart的Activity中的nCreate中的方法需要考到Fragment中的onCreateView方法中

2.在findViewById的前面加上你自己加载的布局View.

如:

tvX = (TextView) view.findViewById(R.id.tvXMax);
tvY = (TextView) view.findViewById(R.id.tvYMax);

猜你喜欢

转载自blog.csdn.net/xuaho0907/article/details/78248307