У меня есть вид коллекции, и в этом первом 3-м элементе должен быть статичным, после чего динамически будет добавляться.Collection view first 3 item должен быть статическим
Проверьте мой код ниже: -
func numberOfSections(in collectionView: UICollectionView) -> Int {
//
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
//
return 20
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
//
// Configure the cell
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier,
for: indexPath) as! AddProductInGroupCell
//cell.backgroundColor = UIColor.white
cell.layer.borderWidth = 0.4
cell.layer.borderColor = UIColor.lightGray.cgColor
cell.layer.cornerRadius = 2
if(3 > indexPath.row)
{
cell.ProductImage.image = UIImage(named : "folder.png")
cell.lableProduct.text = arrCellsLabel[indexPath.row]
cell.imageDotted.isHidden = true
cell.imageLike.isHidden = true
}
cell.delegate = self
return cell
}
при запуске приложения, первый раз, когда он приходит правильно (3 статических клеток), но когда мы прокручиваем вниз и приходим к вновь, что 5 клетки показывают статичными.
Что делать? Благодаря
ваше состояние неправильно брат –
Почему состояние не так? – kishor0011
, но он покажет только два. – kishor0011