开发者

How to act on attributes for custom XML Views

I have created a view called RoundedImageView, the corners are rounded. I want an attribute called开发者_运维问答 cornerRadius that lets me (from the XML) specify the radius. How in the Java code where I have

public class RoundedImageView extends ImageView 

can I actually look for the attribute "cornerRadius" that was specified in the XML?


Here's a link to an example. link

Search for "custom attributes android" for more examples.

Also follow this thread How to retrieve XML attribute for custom control

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜