本文整理了Java中com.bumptech.glide.request.target.ViewTarget.setTag()
方法的一些代码示例,展示了ViewTarget.setTag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewTarget.setTag()
方法的具体详情如下:
包路径:com.bumptech.glide.request.target.ViewTarget
类名称:ViewTarget
方法名:setTag
[英]Sets the android resource id to use in conjunction with View#setTag(int,Object)to store temporary state allowing loads to be automatically cancelled and resources re-used in scrolling lists.
If no tag id is set, Glide will use View#setTag(Object).
Warning: prior to Android 4.0 tags were stored in a static map. Using this method prior to Android 4.0 may cause memory leaks and isn't recommended. If you do use this method on older versions, be sure to call com.bumptech.glide.RequestManager#clear(View) on any view you start a load into to ensure that the static state is removed.
[中]将android资源id设置为与View#setTag(int,Object)结合使用,以存储临时状态,允许自动取消加载,并在滚动列表中重复使用资源。
如果未设置标记id,Glide将使用View#setTag(对象)。
警告:在Android 4.0之前,标签存储在静态地图中。在Android 4.0之前使用这种方法可能会导致内存泄漏,不推荐使用。如果在旧版本上使用此方法,请务必调用com。邦普泰克。滑行RequestManager#清除(视图)启动加载到的任何视图,以确保静态被删除。
代码示例来源:origin: bumptech/glide
/**
* Stores the request using {@link View#setTag(Object)}.
*
* @param request {@inheritDoc}
*/
@Override
public void setRequest(@Nullable Request request) {
setTag(request);
}
代码示例来源:origin: guolindev/giffun
/**
* Stores the request using {@link View#setTag(Object)}.
*
* @param request {@inheritDoc}
*/
@Override
public void setRequest(Request request) {
setTag(request);
}
代码示例来源:origin: mozilla-tw/Rocket
/**
* Stores the request using {@link View#setTag(Object)}.
*
* @param request {@inheritDoc}
*/
@Override
public void setRequest(@Nullable Request request) {
setTag(request);
}
内容来源于网络,如有侵权,请联系作者删除!