Popover
Popover copied to clipboard
Pop Arrow disappears when table view pop over drawn below its button
I want table view pop over below its button but when I make it down arrow disappears
Here is my code:-
let startPoint = CGPoint(x: self.view.frame.width - 60, y: self.rightButtomButton.frame.origin.y + self.rightButtomButton.frame.size.height)
let tableView = UITableView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 135))
tableView.delegate = self
tableView.dataSource = self
tableView.isScrollEnabled = false
let popover1 = Popover(options: nil, showHandler: nil, dismissHandler: nil)
popover1.show(tableView, point: startPoint)
Here is screen shot:-
Why I am not able to get arrow in case of table view ? If delegate & datasource not given then arrow will appear.
Please guide me.
Thanks, Zalak
Have u found any solution to this ?
yes i have this issue too, so fall bak to version 1.0.4
+1
To fix it on this version, create one UIView and add items programmatically . Don't use tableview
It is displayed in the demo project, but where is the difference?
Try to set the arrow size with the options
popover = Popover(
options: [
.type(PopoverType.down),
PopoverOption.blackOverlayColor(UIColor.black.withAlphaComponent(0.7)),
PopoverOption.sideEdge(8),
PopoverOption.arrowSize(CGSize(width: 12, height: 6))], //here
showHandler: nil, dismissHandler: nil)
you just need to clear background of view actually
I discovered that commenting out Popover.layoutSubviews() fixes this problem. I don't know if that breaks other use cases, however.
The change offered by salvasp above doesn't work for me.
I have same too. Also backed to 1.0.4
I have the same issue, I'm using swift 4
To resolve this issue i use version 1.0.4 and fix it to Swift 4
Any luck so far with latest version?
override open func draw(_ rect: CGRect) {
...
color.setFill()
// arrow.fill()
let maskLayer = CAShapeLayer()
maskLayer.path = arrow.cgPath
self.layer.mask = maskLayer
}
try to use Mask replay Fill