Android: How to use the onDraw method in a class extending Activity?

前端 未结 4 1936
离开以前
离开以前 2021-01-11 17:31

As a beginner, I\'ve been building a simple counter application using a simple layout xml and a class called \'Counter\', which derives (extends) from the class Activity.

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-11 17:47

    You don't need to use View.onDraw() for this purpose. Just use layouts and place any drawable image next to your counter, let's say a textview, using the drawableLeft attribute.

    txtview_counter.drawableLeft="@drawable/xxx"

提交回复
热议问题