corin8823 / Popover

Popover is a balloon library like Facebook app. It is written in pure swift.
MIT License
2.09k stars 326 forks source link

Popover height keeps growing every time I open and close the popover #122

Open SimonFernandes7 opened 5 years ago

SimonFernandes7 commented 5 years ago

simulator screen shot - iphone 7 plus - 2019-01-23 at 16 48 42 simulator screen shot - iphone 7 plus - 2019-01-23 at 16 48 35

let options = [ .type(.up), .animationIn(0.3) ] as [PopoverOption] let popover = Popover(options: options, showHandler: nil, dismissHandler: nil) popover.show(passwordValidationView, fromView: sender as! UIButton)

As you can see this custom view size keeps on increasing as it is open multiple times

hslightnin commented 5 years ago

did you figure this one out? I just noticed the same thing today

nizzam commented 5 years ago

What's the solution ?

HelloiWorld commented 5 years ago

Me too,to figure this, I set the arrowSize zero , but it looks so strange.

Cu-Toof commented 5 years ago
switch self.popoverType {
        case .up, .down, .auto:
            frame.size.height += self.arrowSize.height
        case .left, .right:
            frame.size.width += self.arrowSize.height
        }

I find a above code in func create(). This is increase width/height of view.

Cu-Toof commented 5 years ago

My solution: Just remove a below code in Popover file:

override open func layoutSubviews() {
        super.layoutSubviews()
        self.contentView.frame = self.bounds
    }