mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-26 03:01:51 +08:00
Implement custom measure for ios btn when textWrap is true (#4326)
Implement custom measure for ios btn when textWrap is true
This commit is contained in:

committed by
GitHub

parent
014e7a8e0f
commit
e33eca63d6
@ -1,5 +1,5 @@
|
||||
import { Label as LabelDefinition } from ".";
|
||||
import { TextBase, WhiteSpace, whiteSpaceProperty } from "../text-base";
|
||||
import { TextBase, WhiteSpace, whiteSpaceProperty, booleanConverter } from "../text-base";
|
||||
import { profile } from "../../profiling";
|
||||
|
||||
export * from "../text-base";
|
||||
@ -13,6 +13,10 @@ export class Label extends TextBase implements LabelDefinition {
|
||||
return this.style.whiteSpace === "normal";
|
||||
}
|
||||
set textWrap(value: boolean) {
|
||||
if (typeof value === "string") {
|
||||
value = booleanConverter(value)
|
||||
}
|
||||
|
||||
this.style.whiteSpace = value ? "normal" : "nowrap";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user