I want to show a button at the end of the RecyclerView.
There was a method addFooterView with ListView (), how to do the same with RecylerView.
In a way it will be done to make your footer" View Typ "of your adapter In order to do this, getItemViewType overrides to give a different value for your last item. Then onCreateViewHolder, handle different viewType. Do not forget to update the price refund by getCount (by adding 1), and to separate the 2 type of viewholder in the Onbandviewholder (eg With example)
@Override public integer getItemViewType (integer status) {return (position == mData.size ())? VIEW_TYPE_FOOTER: VIEW_TYPE_CELL; }
@Override Public RecyclerView.ViewHolder onCreateViewHolder (ViewGroup parent, integer viewType) {if (viewType == VIEW_TYPE_CELL) {// Create viewholder for your default cell} else {// your foot To view the article, create the viewholder}}
No comments:
Post a Comment