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

fix(flexbox-ios): resolve text size issue for ListView with flexbox layout template by ADjenkov · Pull Request #5799 · NativeScript/NativeScript · GitHub

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ export class FlexboxLayout extends FlexboxLayoutBase {
// As a result we cannot unconditionally measure with EXACTLY the current measured height
const childHeightMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentHeightMeasureSpec,
lp.effectivePaddingTop + lp.effectivePaddingBottom + lp.effectiveMarginTop
+ lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);
+ lp.effectiveMarginBottom, lp.effectiveHeight < 0 ? WRAP_CONTENT : lp.effectiveHeight);

child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
child.effectiveMinWidth = minWidth;
Expand Down Expand Up @@ -820,7 +820,17 @@ export class FlexboxLayout extends FlexboxLayoutBase {
private _stretchViewVertically(view: View, crossSize: number) {
let newHeight = crossSize - view.effectiveMarginTop - view.effectiveMarginBottom;
newHeight = Math.max(newHeight, 0);
view.measure(makeMeasureSpec(view.getMeasuredWidth(), EXACTLY), makeMeasureSpec(newHeight, EXACTLY));
let originalMeasuredWidth = view.getMeasuredWidth();
let childWidthMeasureSpec = FlexboxLayout.getChildMeasureSpec(this._currentWidthMeasureSpec,
view.effectivePaddingLeft + view.effectivePaddingRight + view.effectiveMarginLeft
+ view.effectiveMarginRight, view.effectiveWidth < 0 ? WRAP_CONTENT : Math.min(view.effectiveWidth, originalMeasuredWidth));

view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));

if (originalMeasuredWidth > view.getMeasuredWidth()) {
childWidthMeasureSpec = makeMeasureSpec(originalMeasuredWidth, EXACTLY);
view.measure(childWidthMeasureSpec, makeMeasureSpec(newHeight, EXACTLY));
}
}

private _stretchViewHorizontally(view: View, crossSize: number) {
Expand Down

Back | FazBrowse Home | New Git URL