FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(flexbox-ios): resolve text size issue for ListView with flexbox l… · NativeScript/NativeScript@a03065c · GitHub

Commit a03065c

Browse files
authored andcommitted
fix(flexbox-ios): resolve text size issue for ListView with flexbox layout template (#5799)
* fix(flexbox-layout-ios): resolve text size issue for ListView with flexbox template * fix(flexbox-layout-ios): resolve text size issue for ListView
1 parent 7851629 commit a03065c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout.ios.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ export class FlexboxLayout extends FlexboxLayoutBase {
604604
// As a result we cannot unconditionally measure with EXACTLY the current measured height
605605
const childHeightMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentHeightMeasureSpec,
606606
lp.effectivePaddingTop + lp.effectivePaddingBottom + lp.effectiveMarginTop
607-
+ lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);
607+
+ lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);
608608

609609
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
610610
child.effectiveMinWidth = minWidth;
@@ -820,7 +820,17 @@ export class FlexboxLayout extends FlexboxLayoutBase {
820820
private _stretchViewVertically(view: View, crossSize: number) {
821821
let newHeight = crossSize - view.effectiveMarginTop - view.effectiveMarginBottom;
822822
newHeight = Math.max(newHeight, 0);
823-
view.measure(makeMeasureSpec(view.getMeasuredWidth(), EXACTLY), makeMeasureSpec(newHeight, EXACTLY));
823+
let originalMeasuredWidth = view.getMeasuredWidth();
824+
let childWidthMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentWidthMeasureSpec,
825+
view.effectivePaddingLeft + view.effectivePaddingRight + view.effectiveMarginLeft
826+
+ view.effectiveMarginRight, view.effectiveWidth < 0 ? WRAP_CONTENT : Math.min(view.effectiveWidth, originalMeasuredWidth));
827+
828+
view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));
829+
830+
if (originalMeasuredWidth > view.getMeasuredWidth()) {
831+
childWidthMeasureSpec = makeMeasureSpec(originalMeasuredWidth, EXACTLY);
832+
view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));
833+
}
824834
}
825835

826836
private _stretchViewHorizontally(view: View, crossSize: number) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL