java - How to bind multiple views in butterknife
天蓬老师
天蓬老师 2017-06-30 09:53:10
0
1
684
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);

Why does it report an error when written like this? How does butterknife bind multiple views?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
世界只因有你

When multiple Views are bound to the same class, the annotation processor will look for the id name corresponding to the binding reference in each View. If it cannot find it, an error will be reported.
It is recommended not to bind multiple Views in the same class. You can bind them in inner classes

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template