开发者

Create custom widgets for android

开发者 https://www.devze.com 2023-02-22 13:35 出处:网络
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.

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?


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... />


How to create and access custom components is discussed here

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

0

精彩评论

暂无评论...
验证码 换一张
取 消