修改设置视图以适配多国语言 71/3 71/head
authorluozheng <1732036298@qq.com>
Tue, 23 Apr 2024 11:31:43 +0000 (19:31 +0800)
committerluozheng <1732036298@qq.com>
Tue, 23 Apr 2024 11:31:43 +0000 (19:31 +0800)
code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h
code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp

index fe4c0a0..27b85ae 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-30 09:14:38
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-04-02 20:04:15
+ * @LastEditTime: 2024-04-23 19:24:51
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/include/SettingItemView.h
  */
 /*
@@ -19,6 +19,7 @@
 #include "UiConfig.h"
 #include "SettingModel.h"
 #include "components/ui_label_button_ext.h"
+#include "components/ui_label_ext.h"
 #include "components/ui_image_view.h"
 namespace OHOS
 {
@@ -34,6 +35,7 @@ namespace OHOS
     private:
         SettingItemView(const SettingItemView &);
         UIImageView Icon;
+        UILabelExt settingLabelExt;
         UILabelButtonExt settingLabelButtonExt;
         SettingItem sItemInfo = {SETTING_ITEM_ZERO, nullptr, STR_EXERCISE_GENERAL, false};
     };
index 4a3b850..bf2836d 100644 (file)
@@ -2,7 +2,7 @@
  * @Author: luozheng 1732036298@qq.com
  * @Date: 2024-03-27 19:48:49
  * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-04-03 14:11:23
+ * @LastEditTime: 2024-04-23 19:26:32
  * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/settings/src/SettingItemView.cpp
  */
 
@@ -32,12 +32,14 @@ namespace OHOS
         SetTouchable(true);
         SetUpChild();
         Add(&settingLabelButtonExt);
+        Add(&settingLabelExt);
         Add(&Icon);
     }
 
     SettingItemView::~SettingItemView()
     {
         Remove(&settingLabelButtonExt);
+        Remove(&settingLabelExt);
         Remove(&Icon);
     }
 
@@ -46,7 +48,7 @@ namespace OHOS
         sItemInfo = itemInfo;
         Icon.SetSrc(itemInfo.icon);
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d", itemInfo.textId);
-        settingLabelButtonExt.SetTextId(itemInfo.textId);
+        settingLabelExt.SetTextId(itemInfo.textId);
     }
 
     void SettingItemView::SetUpChild()
@@ -54,6 +56,13 @@ namespace OHOS
         Icon.SetPosition(SETTING_ICON_X, SETTING_SICON_Y);
         Icon.SetStyle(STYLE_IMAGE_OPA, OPA_OPAQUE);
 
+        settingLabelExt.SetPosition(115, 33,180,100); 
+        settingLabelExt.SetStyle(STYLE_TEXT_FONT, 30);
+        settingLabelExt.SetStyle(STYLE_LINE_HEIGHT, 35);
+        settingLabelExt.SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);
+        settingLabelExt.SetRollSpeed(40);
+        settingLabelExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
+
         settingLabelButtonExt.SetPosition(0, 0, 380, 100);
         settingLabelButtonExt.SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
         settingLabelButtonExt.SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);