CLImageViewPopup icon indicating copy to clipboard operation
CLImageViewPopup copied to clipboard

Using CLImageViewPopoup in a table view

Open Pe-te opened this issue 7 years ago • 1 comments

Hi, we have the imageview in a cell in a tableview and sometimes get a weird effect, where the image comes flying in from the bottom instead of just starting where the image was clicked.

Think this line is causing the problem:

    let point = self.convert(self.bounds, to: parentView)
  • GOOD: When the list is at the beginning, the convert works fine:
    self.bounds = (0.0, 0.0, 280.0, 200.0)
    point = (20.0, 59.0, 280.0, 200.0)
  • BAD: When you scroll down the list and then pick an item, the y coordinate is wrong (this should also give y around 59 instead of 2570):
    self.bounds = (0.0, 0.0, 280.0, 200.0)
    point = (20.0, 2570.0, 280.0, 200.0)

Not sure how to fix it properly, maybe check if it is inside a scrollview or there could be a different convert function for that?

Pe-te avatar Jul 18 '17 15:07 Pe-te

Hi, this works for me, any drawbacks?

            let point = self.convert(self.bounds, to: UIApplication.shared.keyWindow)

It would also remove calculation of parentView and findParentViewController().

Pe-te avatar Jul 19 '17 23:07 Pe-te