提交 99677ac2 编写于 作者: O openharmony_ci 提交者: Gitee

!225 解决UIPicker设置不同的FontId会概率性出现字体不显示问题

Merge pull request !225 from wangtiantian/uipicker
......@@ -103,13 +103,7 @@ UILabel* TextAdapter::GetDynamicText(UIView* inView, int16_t index)
for (int16_t i = 0; i < index; i++) {
node = node->next_;
}
UILabel* newView = nullptr;
if (inView == nullptr) {
newView = new UILabel();
} else {
newView = static_cast<UILabel*>(inView);
}
UILabel* newView = CreateUILabel(inView);
if (newView != nullptr) {
newView->SetText(node->data_);
if (fontName_ == nullptr) {
......@@ -127,13 +121,7 @@ UILabel* TextAdapter::GetIntegerText(UIView* inView, int16_t index)
if ((index < 0) || ((integerTextEnd_ - integerTextStart_) < index)) {
return nullptr;
}
UILabel* newView = nullptr;
if (inView == nullptr) {
newView = new UILabel();
} else {
newView = static_cast<UILabel*>(inView);
}
UILabel* newView = CreateUILabel(inView);
if (newView != nullptr) {
char buf[BUF_LEN] = {0};
if (formatter_ != nullptr) {
......@@ -166,6 +154,14 @@ UILabel* TextAdapter::GetIntegerText(UIView* inView, int16_t index)
return newView;
}
UILabel* TextAdapter::CreateUILabel(UIView* inView)
{
if (inView == nullptr) {
return new UILabel();
}
return static_cast<UILabel*>(inView);
}
void TextAdapter::ClearDynamicText()
{
ListNode<const char*>* node = dynamicText_.Begin();
......
......@@ -255,6 +255,7 @@ public:
}
protected:
virtual UILabel* GetTextView(UIView* inView, int16_t index);
virtual UILabel* CreateUILabel(UIView* inView);
uint8_t dataMode_;
private:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册