tencent cloud

Tencent Cloud Super App as a Service

문서Tencent Cloud Super App as a Service

Image Loading API

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-01-16 21:28:11
Warning:
To allow superapps to centrally manage and control image loading, the mini program SDK does not provide a default image loading feature. Instead, it offers a proxy API for superapps to implement image loading. If a superapp does not implement image loading, the following features may display abnormally:
Mini program icons in the capsule panel
Mini program icons in authorization pop-ups
Mini program icons on the loading page
Mini program icons on the About page
The video component cover
The cover-image image
The profile photo
Superapp developers need to customize image loading by overriding the getDrawable method in BaseMiniAppProxyImpl.
API description:
Parameter context: The context of the current mini program process requesting authorization.
Parameter source: The image source, which can be a local or network image.
Parameter width: The width of the image.
Parameter height: The height of the image.
Parameter defaultDrawable: The default image used during loading or on failure.
Return value Drawable: The loaded drawable object.
@Override
public Drawable getDrawable(Context context, String source, int width, int hight, Drawable defaultDrawable)
Example:
@Override
public Drawable getDrawable(Context context, String source, int width, int hight, Drawable defaultDrawable) {
// Integrate your own ImageLoader
// The example code uses the open-source UniversalImageLoader
UniversalDrawable drawable = new UniversalDrawable();
if (TextUtils.isEmpty(source)) {
return drawable;
}
drawable.loadImage(context, source);
return drawable;
}





도움말 및 지원

문제 해결에 도움이 되었나요?

피드백