mirror of
https://github.com/openharmony/ace_engine_lite.git
synced 2026-07-21 08:55:21 -04:00
issueNo: I4C7HL
Description: make the vertical align to top if api version lower than 5 Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: youzhi92 <chenyouzhi@huawei.com> Change-Id: I09d7d184fa254f70484408b7479a8519dce37ac0
This commit is contained in:
@@ -42,9 +42,14 @@ bool TextComponent::CreateNativeViews()
|
||||
{
|
||||
/* set default text OverFlow clip */
|
||||
uiLabel_.SetLineBreakMode(overflowMode_);
|
||||
uiLabel_.SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
|
||||
const int32_t supportBaseLineApiVersion = 5;
|
||||
uiLabel_.SetSupportBaseLine(JsAppContext::GetInstance()->GetTargetApi() >= supportBaseLineApiVersion);
|
||||
if (JsAppContext::GetInstance()->GetTargetApi() < supportBaseLineApiVersion) {
|
||||
uiLabel_.SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT, UITextLanguageAlignment::TEXT_ALIGNMENT_TOP);
|
||||
uiLabel_.SetSupportBaseLine(false);
|
||||
} else {
|
||||
uiLabel_.SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT, UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER);
|
||||
uiLabel_.SetSupportBaseLine(true);
|
||||
}
|
||||
return CopyFontFamily(fontFamily_, ProductAdapter::GetDefaultFontFamilyName());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user