【问题标题】:Collection view alignment issue in different version不同版本中的集合视图对齐问题
【发布时间】:2018-01-24 05:18:27
【问题描述】:

集合视图在 iOS 10.3.3 中向上移动。但在 iOS 11.0 中工作正常。 谁能告诉我如何解决这种与版本有关的问题

CollectionView 约束。

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
MSProductCategoryViewController
*msProductCategoryViewController = [storyBoard instantiateViewControllerWithIdentifier:@"MSProductCategoryViewController"];
msProductCategoryViewController.title =titleName;
[self.navigationController pushViewController:msProductCategoryViewController animated:YES];

【问题讨论】:

  • 你检查过约束吗?应该不是ios版本问题
  • 我的约束很好!
  • 显示您的收藏视图约束。
  • 我不这么认为。请提供collectionview约束
  • 我更新了!请检查约束

标签: ios objective-c uicollectionview storyboard


【解决方案1】:

对于 CollectionView 向上移动的问题,请检查您是否在情节提要中取消选择了 ViewController 的“调整滚动视图插图”属性。

Attributes Inspector of ViewController

您添加了值为 20 的顶部约束。我假设您想为集合视图添加顶部填充。如果这是原因,那么我建议使用 CollectionView 的“Section Insets”属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-22
    • 2023-03-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多