【问题标题】:UICollectionView not showing images in iOS 10UICollectionView 未在 iOS 10 中显示图像
【发布时间】:2017-01-24 17:38:05
【问题描述】:

我的UICollectionViewiOS 10除了 的所有版本都可以正常工作。我正在使用UIImageView 来显示图像。

我在应用程序的ContentFolder 中保存了图像。

我正在使用NSData *imageData = [NSData dataWithContentsOfFile:filename]; 获取图像的数据并使用UIImage *image = [UIImage imageWithData:imageData]; 创建我要显示的图像。

有谁知道问题出在哪里?

【问题讨论】:

    标签: ios objective-c uiimageview uicollectionview ios10


    【解决方案1】:

    将集合视图的 isPrefetchingEnabled 属性设置为 false(在 iOS 10 中默认为 true)。

    【讨论】:

    • 谢谢它的工作!您是从哪里得知该物业的?
    • 我刚刚在苹果开发者网站上阅读了有关 ios10 中 uicollectionview 更新的信息。
    【解决方案2】:

    clipsToBounds 和cornerRadius 可能会产生影响。这解决了我的问题。 iOS 10 GM with xcode 8 GM causes views to disappear due to roundedCorners & clipsToBounds

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-16
      • 1970-01-01
      相关资源
      最近更新 更多