From: luozheng <1732036298@qq.com> Date: Thu, 14 Nov 2024 10:46:30 +0000 (+0800) Subject: 解决系统界面最后一个组件被遮挡住bug X-Git-Tag: fd230_release_V1.3.102~29^2~33 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=3a34f60142f4a260a3039428f5784f26be30b3ab;p=mirrors%2FFD230.git 解决系统界面最后一个组件被遮挡住bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h index ba3335044..b22d6ae13 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-03-30 18:29:39 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-09-19 20:07:09 + * @LastEditTime: 2024-11-14 18:32:02 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/system/include/SystemView.h */ #ifndef SYSTEM_VIEW_H @@ -112,8 +112,10 @@ namespace OHOS void NeedToUpdateImageinit(void); UILabelExt *Title{nullptr}; // 标题 UIScrollView *SystemScrollView[MAX_SYSTEMVIEWID]{nullptr}; - UILabelButtonExt *SystemViewLabelButton[7]{nullptr}; - UILabelExt *SystemViewLabel[7]{nullptr}; + UILabelButtonExt *SystemViewLabelButton[10]{nullptr}; + UILabelExt *SystemViewLabel[10]{nullptr}; + int SystemViewLabelNum{0}; + int SystemViewButtonNum{0}; UIImageView *NeedToUpdateImage{nullptr}; // 提示需要系统更新的icon图片 UIImageView *temp{nullptr}; bool viewInitStatus{false}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp index 057508bee..1ab069be3 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/system/src/SystemView.cpp @@ -193,7 +193,8 @@ namespace OHOS .lineBreakMode = UILabel::LINE_BREAK_OSCILLATION, }; int pos_y = 153; - for (int i = 0; i < sizeof(labelSetups) / sizeof(labelSetups[0]); ++i) + SystemViewLabelNum = sizeof(labelSetups) / sizeof(labelSetups[0]); + for (int i = 0; i < SystemViewLabelNum; ++i) { labelConfig.top = pos_y + 120*i; @@ -230,7 +231,8 @@ namespace OHOS }; int pos_y = 120; - for (int i = 0; i < sizeof(buttonSetups) / sizeof(buttonSetups[0]); ++i) + SystemViewButtonNum = sizeof(buttonSetups) / sizeof(buttonSetups[0]); + for (int i = 0; i < SystemViewButtonNum; ++i) { ButtonConfig buttonconfig = { .x = 43, @@ -316,7 +318,7 @@ namespace OHOS { return; } - temp->SetPosition(43, 840, 380, 40); + temp->SetPosition(43, (SystemViewButtonNum + 1) * 120, 380, 40); temp->SetVisible(false); SystemScrollView[SYSTEMVIEW]->Add(temp); }