ios - uicollectionview rotation cell visibility & position and order -


I have a UICollectionView that has 3 columns and 5 rows. They are stable and will not be changed. UICollectionView should not be scrolled, so cells appear full-time, it looks good in picture mode, but the scene is messed up in landscape mode. How to reorder cells in a meaningful way? Or is it possible to spread the contents so that all cells appear?

Image : Enter image details here

Scenarios : Enter image details here

  - (zero) viewDidoadload [[Super Viewedload]; UICollectionViewFlowLayout * Layout = [[UICollectionViewFlowLayout alloc] init]; Layout. scrollDirection = UICollectionViewScrollDirectionVertical; UICollectionView * collec = [[UICollectionView alloc] initWithFrame: CGRectMake (0, 160, 320, 280) archiveView: layout]; [Colek Register Class: CellWithReuseIdentifier for [UICollectionViewCell class]: @ "test"]; Collec.backgroundColor = [UIColor yellowColor]; Collec.delegate = self; Collec.dataSource = self; Collec.scrollEnabled = NO; Collec.translatesAutoresizingMaskIntoConstraints = No; [Self.view addSubview: collec]; NSDictionary * headerViewDic = @ {@ "collec": Colec}; NSArray * constraintsHeaderView = [NSLayoutConstraint Visual Formats with Obstacles: @ "| [Kolke |] |" Options: 0 metric: zero views: header viewer]; NSArray * constraintsHeaderViewV = [NSLayoutConstraint Visual Format with Hurdles: @ "V: | -160- [Colec] -8- |" Options: 0 metric: zero views: header viewer]; [Self.view addConstraints: constraintsHeaderView]; [Self.view addConstraints: constraintsHeaderViewV]; [Coleck set content hogging Priority: UILAuthProtectionEquare for Acacia: ULTIT Consultant Axis Horizontal | UILayoutConstraintAxisVertical]; } - (NSInteger) collectionView: (UICollectionView *) collectionView numberOfItemsInSection: (NSInteger) section {return3; } - (NSInteger) numberOfSectionsInCollectionView: (UICollectionView *) collectionView {return 5; } - (UICollectionViewCell *) collectionView: (UICollectionView *) collectionView cellForItemAtIndexPath: (NSIndexPath *) indexPath {UICollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier: @ "test" forIndexPath: indexPath]; Cell.backgroundColor = [UIColor blueColor]; Return cell; } - (CGSize) collectionView: (UICollectionView *) collectionView layout: (UICollectionViewLayout *) collectionViewLayout sizeForItemAtIndexPath: (NSIndexPath *) indexPath {CGSize mElementSize = CGSizeMake (97, 50); Return mahila size; } - (CGFloat) collectionView: (UICollectionView *) collectionView layout: (UICollectionViewLayout *) collectionViewLayout minimumInteritemSpacingForSectionAtIndex: (NSInteger) section {return 0; } - See the (CGFloat) collection: (UICollectionView *) archiveview layout: (UICollectionViewLayout *) archive ViewLayout minimumLineSpacingForSectionAtIndex: (NSInteger) section {return 0; } - (UIEdgeInsets) collectionView: (UICollectionView *) collectionView layout: (UICollectionViewLayout *) collectionViewLayout insetForSectionAtIndex: (NSInteger) section {return UIEdgeInsetsMake (0,7,7,7); // top, left, bottom, right}  

Try searching for device orientation and Then swap your section and row values ​​so that your line is


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -