解决屏保不切换的问题,解决头发锯齿问题
authorxue <2144439972@qq.com>
Tue, 28 Oct 2025 03:17:48 +0000 (11:17 +0800)
committerxue <2144439972@qq.com>
Tue, 28 Oct 2025 03:17:48 +0000 (11:17 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdMainView.cpp

index 132fe03..11990e9 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include "common/image_cache_manager.h"
+#include "imgdecode/cache_manager.h"
 #include "ui_resource_image.h"
 #include <ui_scroll_view.h>
 #include "components/ui_button.h"
@@ -737,7 +738,7 @@ namespace OHOS
             GRAPHIC_LOGE("surfaceView is nullptr\n");
             return;
         }
-        colorKey_.full = 0xff202020;
+        colorKey_.full = 0xffecdbd4;
         surfaceView_->SetViewId("sur");
         surfaceView_->SetPosition(0, 0, VIDEO_WIDTH, VIDEO_HEIGHT);
         surfaceView_->SetStyle(STYLE_BACKGROUND_COLOR, Color::Black().full);
@@ -820,6 +821,11 @@ namespace OHOS
           
         
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdMainView::SwitchIconImage: Switching to image: %s", imagePath);
+        
+        // 清除图片缓存,确保重新加载
+        CacheManager::GetInstance().Close(imagePath);
+        
+        // 设置新的图片源
         iconView->SetSrc(imagePath);
         iconView->Invalidate();
     }