mirror of
https://github.com/openharmony/ace_engine_lite.git
synced 2026-07-19 13:31:06 -04:00
!394 若应用API level小于5,text/marquee组件文件垂直方向对齐默认方式设置为顶部对齐。否则设置为居中对齐。
Merge pull request !394 from youzhi92/text-vertical-align
This commit is contained in:
@@ -245,7 +245,12 @@ void TextComponent::SetTextAlign(UILabelTypeWrapper &label, const AppStyleItem *
|
||||
stylePropValue);
|
||||
break;
|
||||
}
|
||||
label.SetAlign(align, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
|
||||
const int32_t defaultVerticalAlignCenterApiVersion = 5;
|
||||
if (JsAppContext::GetInstance()->GetTargetApi() < defaultVerticalAlignCenterApiVersion) {
|
||||
label.SetAlign(align, UITextLanguageAlignment::TEXT_ALIGNMENT_TOP);
|
||||
} else {
|
||||
label.SetAlign(align, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
|
||||
}
|
||||
}
|
||||
} // namespace ACELite
|
||||
} // namespace OHOS
|
||||
|
||||
Reference in New Issue
Block a user