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:
Alexander Vakrilov
2017-06-08 10:29:50 +03:00
committed by GitHub
parent 014e7a8e0f
commit e33eca63d6
7 changed files with 101 additions and 20 deletions

View File

@ -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";
}