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
精彩评论