corin8823 / Popover

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

Popover is not visible / doesn't appear #87

Closed Maxatma closed 7 years ago

Maxatma commented 7 years ago

using this function:

  open func show(_ contentView: UIView, fromView: UIView) {
    guard let rootView = UIApplication.shared.windows.last ?? UIApplication.shared.keyWindow else {
        return
    }
    self.show(contentView, fromView: fromView, inView: rootView)
  }

I have a problem. Just show popover is okay, but when i do something like open another screen and then come back, I have popover invisible. Researched the problem, i have:

(lldb) po rootView
<UIRemoteKeyboardWindow: 0x7fbd7775bee0; frame = (0 0; 414 736); opaque = NO; autoresize = W+H; layer = <UIWindowLayer: 0x60000003e300>>

when return from another controller.

artekr commented 7 years ago

I think this has been fixed in this commit: Fix key window #80, update your Popover to latest version should revolve the issue.

ghost commented 7 years ago

a控制器的Nav已经隐藏了 但是在Nav的右边有一个按钮 点击该按钮会有popview的效果

    let PPView = PopView(frame: CGRect(x: 0, y: 0, width: kScreenW/2.65, height: kScreenH/4.65))
    let options = [
        .type(.down),
        .animationIn(0.3),
        .animationOut(0.2),
        .color((UIColor.init(red: 54/256, green: 54/256, blue: 54/256, alpha: 0.5))),
        .blackOverlayColor(UIColor.clear),
        .arrowSize(CGSize(width:20, height:15))

        ] as [PopoverOption]
    let popover = Popover(options: options, showHandler: nil, dismissHandler: nil)
    print("----------------\(popover)")

    popover.show(PPView, fromView: btn)

    PPView.ComeonBtn.addTarget(self, action: #selector(popClick2), for: .touchUpInside)
    PPView.OnlineBtn.addTarget(self, action: #selector(popClick), for: .touchUpInside)
    PPView.NodisturbBtn.addTarget(self, action: #selector(popClick1), for: .touchUpInside)

PPView是自己写的一个view
问题如下:在该界面点击跳转2级页面都是正常的,当我点击tabbar跳转另外一个子控制器b 再回来点pop也是正常的,可是当我点击了b控制器的Nav进入到子界面的时候 再回a控制点击pop就变得没效果了 请问是为什么

ghost commented 7 years ago

Also fixed in #80 @corin8823