Skip to content

Commit

Permalink
fix(ios): allow layout change within a cell.
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Mar 10, 2021
1 parent 3458c63 commit 6737df6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/collectionview/collectionview.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,12 @@ export class CollectionView extends CollectionViewBase {
this._addView(view);
const innerView = NSCellView.new() as NSCellView;
innerView.view = new WeakRef(view);
// view['performLayout'] = ()=>{};
// for a cell to update correctly on cell layout change we need
// to do it ourself instead of "propagating it"
view['performLayout'] = () => {
this.measureCell(cell, view, indexPath);
this.layoutCell(indexPath.row, cell, view);
};
innerView.addSubview(view.nativeViewProtected);
cell.contentView.addSubview(innerView);
}
Expand Down

2 comments on commit 6737df6

@vallemar
Copy link
Contributor

@vallemar vallemar commented on 6737df6 Mar 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @farfromrefug,
I was having a problem on ios, if I tried to change the height of an already rendered row it overflows onto the next row. does this change solve that or is it my mistake?

@farfromrefug
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vallemar it depends on what you do and how you do it. can't tell without sample code

Please sign in to comment.