1

I have a value in my Activity which represents the "progress" of a certain player in context of a goal to achieve (e.g., a player needs 10 wins, he got 3 wins -> progress = 30%).

What I want now is to load an "empty" Image and fill it relative to the progress value.

E.g.

enter image description here

is manipulated to

enter image description here

But now I absolutely don't know how to achieve this. I had in mind that the easiest way would be a Java-function with parameter progress that loads that empty image and draws x vertical lines (whereby x is = progress as int) on that image and returns it.

Now I've read some Tutorials, but I still don't get how I can load that png, draw some stuff on it and return it whitout saving the drawings in it. Has anyone an idea how to perform this?

4

1 に答える 1

1

Androidのプログレスバー機能を使用できます。http://developer.android.com/reference/android/widget/ProgressBar.html

ダイアログに表示したくない場合は、直接埋め込むことができます。

これが役立つかもしれない別の答えです: ダイアログではなくUIに埋め込まれたAndroidプログレスバー

カスタムプログレスダイアログを作成する方法は次のとおりです。ProgressBar/ProgressDialogのカスタムドローアブル

お役に立てば幸いです。

于 2012-10-07T18:03:26.173 に答える