Reputation: 4695
public class Class1View extends LinearLayout{
@Override
protected void onFinishInflate(){
super.onFinishInflate();
Butterknife.bind(this);
}
}
How do I create a new view, for example, a new Button() and add it to this Class1View
I tried,
Butterknife.bind(this, new Button(getContext());
but it does not work.
Upvotes: 0
Views: 627
Reputation: 6704
As per my understanding, Butterknife is there to help you bind a View element which is declared somewhere in XML. Since you're extending a View and want to add more Views within it dynamically, butterknife here is no use.
Upvotes: 1