文章详情页
java - butterknife怎么绑定多个view
浏览:77日期:2023-10-22 09:42:32
问题描述
View view = View.inflate(context, R.layout.news_item_pager, null);ButterKnife.bind(this, view);View rollView = View.inflate(context, R.layout.layout_roll_view, null);ButterKnife.bind(this,rollView);
这样写为什么报错 butterknife怎么绑定多个view?
问题解答
回答1:在同一个类中绑定了多个View的情况下,注解处理器会在每一个View中寻找绑定引用对应的id名,找不到就会报错。建议不要在同一个类中绑定多个View,可以在内部类中绑定
标签:
java
相关文章:
排行榜