Android: Tutorial on Custom View creation [closed]

2019-03-18 03:54发布

问题:

Can anyone suggest a good tutorial about how to create custom view?

回答1:

I was asking myself the same question. Doing a searches on Google, I found some good info. First of all you should start by reading the documentation presented by Google Android:

  • http://developer.android.com/guide/topics/ui/custom-components.html

After that, for general tutorials of a view that extends the android.view.View class, these seem to be good examples:

  • http://www.androidcompetencycenter.com/2009/08/creatingcustomviews/
  • http://www.skill-guru.com/blog/2011/01/20/creating-a-custom-widgets-in-android/

As for using the android.view.ViewGroup, there seems to be already some posts on the subject:

  • How to use viewGroup in android
  • custom ViewGroup example?
  • Can anyone give a good example of a Custom ViewGroup containing a Custom View with measure and layout examples? (In Java)


回答2:

Custom View - HorizontalSlider | Hello Android

http://www.helloandroid.com/tutorials/custom-view-horizontalslider