简体   繁体   English

手机在iPhone X中无法正常显示

[英]Cell not show properly in iphone X

can anyone help me, Cell in iphone X is not showing properly, it show upside in collection view. 谁能帮我,iphone X中的Cell无法正常显示,它在收藏夹视图中显示出上升空间。

but same cell and code working fine in all other devices. 但是相同的单元格和代码可以在所有其他设备上正常工作。

 func collectionView(_ collectionView: UICollectionView,layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
   return CGSize(width: NIConstant.SCREEN_WIDTH, height: NIConstant.SCREEN_WIDTH)
 }

在此处输入图片说明

RESOLVED 解决

the problem resolved by adding the piece of code in viewDidLoad method 通过在viewDidLoad方法中添加代码段解决的问题

if #available(iOS 11.0, *) {
   fullScreenCollectionView?.contentInsetAdjustmentBehavior = .always
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM