roberthein / BouncyLayout

Make. It. Bounce.
MIT License
4.24k stars 197 forks source link

Flipped CollectionView (Chat) #27

Open beamercola opened 6 years ago

beamercola commented 6 years ago

This pod looks great, super clean. I'm having an issue with a flipped collectionview and cell (chat app) though and not sure why.

I've tried both:

let layout = BouncyLayout()
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView!.transform = CGAffineTransform.init(rotationAngle: (-(CGFloat)(Double.pi)))
// ...

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  // ...
  cell.transform = CGAffineTransform(rotationAngle: CGFloat.pi)
  return cell
}

and

let layout = BouncyLayout()
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView!.transform = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: 0)
// ...

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  // ...
  cell.transform = collectionView.transform
  return cell
}

Both create different results. Any ideas? Thanks!

marchy commented 5 years ago

Any ideas for how to achieve this?

Given that messaging is one of the core use cases for this having the reverse items show up properly is key – and hopefully supported by the lib.

Kind thanks.

fmirault commented 5 years ago

I'm trying to do the same effect, does aynone has achieved this successfully ?

aminosman commented 5 years ago

Same issue here any update?

timothyerwin commented 3 years ago

I think flipping around the views is hacky...there are other options available such as updating the content offset