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.