UIPopoverController not dismissed when opened from self.navigationItem (inside UINavigationController)

前端 未结 4 1696
醉话见心
醉话见心 2021-01-24 21:06

I have a problem dismissing a popover that was launched from the navigationItem of a UINavigationController. It seems that the navigation item which is inserted by the UINavigat

4条回答
  •  不要未来只要你来
    2021-01-24 21:57

    https://stackoverflow.com/a/12874772/1455770

    after presenting a popover from a bar button item, the popover has had its "passthroughViews" set to include the nav bar, so your taps don't register. Set the passthroughviews to nil straight after you present the popover. ie.

    self.myPopoverController presentPopoverFromBarButtonItem:myBarButtonItem permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    self.myPopoverController.passthroughViews = nil;// at this point the myPopoverController has had its pass through views set to include the whole nav bar. remove it.
    

提交回复
热议问题