[問題] DountChartView 重繪

作者: j0918jack (東港)   2016-10-04 14:03:43
各位前輩好,小弟目前要處理一個DountChartView
大概像這樣 https://goo.gl/EhjLL8
但是會隨著所選取的資料去更動圖的分布
目前遇到的問題是
只能在程式開啟時畫一次圖
資料更換時不知道怎麼去刷新圖......
部分程式碼大概如下
MainActivity裡畫圖的方法:
https://gist.github.com/anonymous/d498321e23d6ec7472b03bcfd0127152
畫圖的java檔:
https://gist.github.com/anonymous/b40b5e66b6f725e93bd00a40a08fb082
不好意思麻煩各位幫我解惑
感激不盡
作者: passli   2016-10-04 14:30:00
把那個view remove 再加一次?
作者: gohomexx (gohomexx)   2016-10-04 17:15:00
view.invalidate() ?
作者: FlowerYen (Greg)   2016-10-05 13:36:00
畫圖的部分,再多開一個setValue的function不然你value只有在建構的時候才會傳入這樣如果要更新資料時,都要重new一個view更新完資料後call invalidate 就會強制view重繪了

Links booklink

Contact Us: admin [ a t ] ucptt.com