1. 程式人生 > >You must not call setTag() on a view Glide is targeting

You must not call setTag() on a view Glide is targeting

遇到這種錯誤無論你使用的是RecycleView還是ListView,在給View設定tag的時候一定要注意,千萬別給ImageView和其他View設定tag。可以給ImageView的外層父佈局setTag(),這樣就不會報錯了

//這樣就會報錯
holder.image.setTag(position);
//通過給父佈局設定tag就不會報錯
holder.relativeLayout.setTag(position);