Browse Source

VLCMediaCategoryViewController: correctly size cells

When we turn the device while watching a movie we don't get the safeareas did change event
the calculation was therefor based on a wrong width. Relayouting in viewwillAppear fixes this issue

(closes #524)
Carola Nitz 6 years ago
parent
commit
42a59e8a85
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Sources/MediaCategories/MediaCategoryViewController.swift

+ 2 - 0
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -159,6 +159,8 @@ class VLCMediaCategoryViewController: UICollectionViewController, UICollectionVi
             manager.start()
             manager.start()
         }
         }
         manager.presentingViewController = self
         manager.presentingViewController = self
+        cachedCellSize = .zero
+        collectionView.collectionViewLayout.invalidateLayout()
     }
     }
 
 
     @objc func themeDidChange() {
     @objc func themeDidChange() {