Search code examples
androidlayoutondraw

Create custom widgets for android


I'm trying to create a rotating imageView. Looking at this (http://stackoverflow.com/questions/1930963/rotating-a-view-in-android) I know I'll have to override onDraw.

But when I create my own derrived TextView class, how do I use it in my xml layouts?


Solution

  • To use it in your xml layout add the following:

    <view class="yourpackage.yourclass.yourview" ...additional parameters... />
    

    note the lowercase "view" or by directly specifying its name

    <yourpackage.yourclass.yourview ...additional parameters... />