mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(ios): label measure correct height when using custom numberOfLines (#9945)
This commit is contained in:
committed by
Nathan Walker
parent
351172e65b
commit
2ff0891f93
@@ -104,7 +104,7 @@ export class Label extends TextBase implements LabelDefinition {
|
||||
private _measureNativeView(width: number, widthMode: number, height: number, heightMode: number): { width: number; height: number } {
|
||||
const view = <UILabel>this.nativeTextViewProtected;
|
||||
|
||||
const nativeSize = view.textRectForBoundsLimitedToNumberOfLines(CGRectMake(0, 0, widthMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : layout.toDeviceIndependentPixels(width), heightMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : layout.toDeviceIndependentPixels(height)), 0).size;
|
||||
const nativeSize = view.textRectForBoundsLimitedToNumberOfLines(CGRectMake(0, 0, widthMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : layout.toDeviceIndependentPixels(width), heightMode === 0 /* layout.UNSPECIFIED */ ? Number.POSITIVE_INFINITY : layout.toDeviceIndependentPixels(height)), view.numberOfLines).size;
|
||||
|
||||
nativeSize.width = layout.round(layout.toDevicePixels(nativeSize.width));
|
||||
nativeSize.height = layout.round(layout.toDevicePixels(nativeSize.height));
|
||||
|
||||
Reference in New Issue
Block a user