-1

Possible Duplicate:
android component for audio volume

I am new to android and I am truly sorry if I am asking a rookie question but I am really stuck. Since now I used android built in components like android:button and etc. Now I want to make a custom view. Am I able to use canvas and also add android built in components?

I want to be able to draw lines in a view but be also able to use android:button and other components. Is it the right approach? Can any one help me with some links or tutorials?

Actually my goal is to create a voice meter like this pic:

enter image description here

Community
  • 1
  • 1
Arash khangaldi
  • 110
  • 2
  • 15
  • you can read official docs http://developer.android.com/guide/topics/graphics/2d-graphics.html – logcat Oct 07 '12 at 07:38

1 Answers1

1

You can create a custom view by extending the View class. You override OnDraw and use Canvas & Paint to draw your view.

There is a good example how to do this in Professional Android Development 4 by Reto Meier. You can download the source code for the example from the Wrox website www.wrox.com. Search for Reto Meier. The example shows you how to draw a view for a Compass (Chapter 4).

CocoNess
  • 4,213
  • 4
  • 26
  • 43