如何通过android中的自定义属性查找视图

时间:2012-06-14 16:30:54

标签: android xml

如何通过引用其属性来获取组件?

Button attribute1 = "@+myAttributes/one"/>

//something like
Button Button1 = (Button) findViewByattribute1(R.myAttributes.one);

1 个答案:

答案 0 :(得分:0)

尝试使用以下代码。

Button buttonName = (Button) findViewById(R.id.yourButton);