提交 3167b90a 编写于 作者: W wangtiantian

IssueNo:https://gitee.com/openharmony/graphic_ui/issues/I3YQ8L

Description:fix uipicker bug
Sig:graphic
Feature or Bugfix:Bugfix
Binary Source:No
Signed-off-by: Nwangtiantian <wangtiantian19@huawei.com>
上级 5ebc3d27
......@@ -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.
先完成此消息的编辑!
想要评论请 注册