InitImageView函数优化图片不再使用LoadSingleRes 3255/1
authorluozheng <1732036298@qq.com>
Mon, 9 Mar 2026 07:11:03 +0000 (15:11 +0800)
committerluozheng <1732036298@qq.com>
Mon, 9 Mar 2026 07:11:03 +0000 (15:11 +0800)
code/sdk/zhihui/UI/CustomUIComponentTool/uicomponents/UIComponents.cpp

index 0d66ea6..1bec6ec 100644 (file)
@@ -445,15 +445,16 @@ bool InitImageView(UIImageView *&imageView, int left, int top, int width,
   imageView->SetPosition(left, top);
   imageView->SetAutoEnable(true);
   imageView->SetViewId(viewId);
+  imageView->SetSrc(imagePath);
 
-  ImageInfo *image =
-      ImageCacheManager::GetInstance().LoadSingleRes(imagePath, false);
-  if (image == nullptr) {
-    WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
-                  "LoadAllDialFromRam loadimage %s fail", imagePath);
-    return false;
-  }
-  imageView->SetSrc(image);
+  // ImageInfo *image =
+  //     ImageCacheManager::GetInstance().LoadSingleRes(imagePath, false);
+  // if (image == nullptr) {
+  //   WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP,
+  //                 "LoadAllDialFromRam loadimage %s fail", imagePath);
+  //   return false;
+  // }
+  // imageView->SetSrc(image);
   return true;
 }
 /*带默认参数的初始化label*/