如何处理自定义XML视图的属性

时间:2011-07-11 19:30:16

标签: android android-layout android-custom-view

我创建了一个名为RoundedImageView的视图,角是圆角的。我想要一个名为cornerRadius的属性,它允许我(从XML)指定半径。我在Java代码中如何

public class RoundedImageView extends ImageView 

我可以实际查找XML中指定的属性“cornerRadius”吗?

1 个答案:

答案 0 :(得分:0)

这是一个示例链接。 link

搜索“自定义属性android”以获取更多示例。

另请遵循此主题How to retrieve XML attribute for custom control