提交 a9a3aecd 编写于 作者: O openharmony_ci 提交者: Gitee

!103 UILabel组件SetX和SetY后没有刷新位置

Merge pull request !103 from wangtiantian/UIlabelMaster
......@@ -257,6 +257,22 @@ void UILabel::SetHeight(int16_t height)
}
}
void UILabel::SetX(int16_t x)
{
if (GetX() != x) {
UIView::SetX(x);
RefreshLabel();
}
}
void UILabel::SetY(int16_t y)
{
if (GetY() != y) {
UIView::SetY(y);
RefreshLabel();
}
}
void UILabel::RefreshLabel()
{
Invalidate();
......
......@@ -405,6 +405,22 @@ public:
*/
void SetHeight(int16_t height) override;
/**
* @brief Sets the x-coordinate for the view.
* @param x Indicates the x-coordinate to set.
* @since 1.0
* @version 1.0
*/
void SetX(int16_t x) override;
/**
* @brief Sets the y-coordinate for the view.
* @param y Indicates the y-coordinate to set.
* @since 1.0
* @version 1.0
*/
void SetY(int16_t y) override;
protected:
Text* labelText_;
void RefreshLabel();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册