简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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