ButterKnife中如何绑定列表的头View和脚View

创建一个ViewHolder,把你要操作的View都在里面绑定

class HeaderViewHolder {
        @BindView(R.id.tv_headerview)
        TextView tv_headerview;

        public HeaderViewHolder(View headerRootView) {
            ButterKnife.bind(this, headerRootView);
        }
    }
HeaderViewHolder headerViewHolder = new HeaderViewHolder(headView);
headerViewHolder.tv_headerview.setText("我是头view");

你可能感兴趣的:(ButterKnife中如何绑定列表的头View和脚View)