解决二维码大小跳变问题
authorxue <2144439972@qq.com>
Thu, 6 Nov 2025 06:53:43 +0000 (14:53 +0800)
committerxue <2144439972@qq.com>
Thu, 6 Nov 2025 06:53:43 +0000 (14:53 +0800)
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdDialogueView.cpp
code/sdk/application/wearable/ln/nativeapp/nativeui/thunderbird/src/ThunderBirdGuideView.cpp

index d511fb2..776c53a 100644 (file)
@@ -182,7 +182,7 @@ namespace OHOS
             }
             if (TextLabel)
             {
-                TextLabel->SetPosition(TextLabel_Y->GetX()-1.5, TextLabel_Y->GetY()-1.5, 325, 42);
+                TextLabel->SetPosition(TextLabel_Y->GetX()-2, TextLabel_Y->GetY()-2, 325, 42);
                 TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
                 TextLabel->SetVisible(true);
             }
@@ -245,7 +245,7 @@ namespace OHOS
             }
             if (TextLabel)
             {
-                TextLabel->SetPosition(TextLabel_Y->GetX()-1.2, TextLabel_Y->GetY()-1.2, 325, 42);       
+                TextLabel->SetPosition(TextLabel_Y->GetX()-2, TextLabel_Y->GetY()-2, 325, 42);       
                 TextLabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
                 TextLabel->SetText(currentStatusText.c_str());
                 TextLabel->SetVisible(true);
index f7bc820..de7cd7a 100644 (file)
@@ -82,6 +82,7 @@ namespace OHOS
         {
             qrcode_->SetPosition(119, 157, 111, 111);
             qrcode_->SetQrcodeInfo(ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str());
+            qrcode_->SetPosition(119, 157, 111, 111);
             qrcode_->SetStyle(STYLE_PADDING_LEFT, 4);
             qrcode_->SetStyle(STYLE_PADDING_RIGHT, 4);
             qrcode_->SetStyle(STYLE_PADDING_TOP, 4);
@@ -308,6 +309,7 @@ namespace OHOS
             {
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdGuideView::qrcode_ path:%s", ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str());
                 qrcode_->SetQrcodeInfo(ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str());
+                qrcode_->SetPosition(119, 157, 111, 111);
                 qrcode_->SetVisible(true);
             }
             if(RemindIcon)
@@ -339,10 +341,10 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "start qrcode path:%s", ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str());
             
             // 重新设置二维码的尺寸和样式,防止变小
-            qrcode_->SetPosition(119, 157, 111, 111);            
+               
             
             qrcode_->SetQrcodeInfo(ThunderBirdModel::GetInstance()->GetQrcodeContent().c_str());
-            
+            qrcode_->SetPosition(119, 157, 111, 111);        
             // 强制重新设置尺寸,防止SetQrcodeInfo后尺寸被改变
             qrcode_->Invalidate();//刷新
         }