Skip to content

Commit 20c86db

Browse files
committed
fix(ios): correctly measure when no rowHeight in horizontal or no colWidth in vertical
1 parent 62d04f7 commit 20c86db

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/collectionview/index.ios.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -815,18 +815,14 @@ export class CollectionView extends CollectionViewBase {
815815
}
816816
}
817817

818-
const widthMeasureSpec = width
819-
? Utils.layout.makeMeasureSpec(width, Utils.layout.EXACTLY)
820-
: horizontal
821-
? infinity
822-
: Utils.layout.makeMeasureSpec(this._innerWidth, Utils.layout.UNSPECIFIED);
818+
const widthMeasureSpec = width ? Utils.layout.makeMeasureSpec(width, Utils.layout.EXACTLY) : horizontal ? infinity : Utils.layout.makeMeasureSpec(this._innerWidth, Utils.layout.EXACTLY);
823819
const heightMeasureSpec = height
824820
? Utils.layout.makeMeasureSpec(height, Utils.layout.EXACTLY)
825821
: horizontal
826-
? Utils.layout.makeMeasureSpec(this._innerHeight, Utils.layout.UNSPECIFIED)
822+
? Utils.layout.makeMeasureSpec(this._innerHeight, Utils.layout.EXACTLY)
827823
: infinity;
828824
if (Trace.isEnabled()) {
829-
CLog(CLogTypes.log, 'measureCell', position, width, height, widthMeasureSpec, heightMeasureSpec);
825+
CLog(CLogTypes.log, 'measureCell', position, width, height, this._innerWidth, this._innerHeight, widthMeasureSpec, heightMeasureSpec);
830826
}
831827
const measuredSize = View.measureChild(this, cellView, widthMeasureSpec, heightMeasureSpec);
832828
const result: [number, number] = [measuredSize.measuredWidth, measuredSize.measuredHeight];

0 commit comments

Comments
 (0)