Popover icon indicating copy to clipboard operation
Popover copied to clipboard

Pop Arrow disappears when table view pop over drawn below its button

Open ZalakSA opened this issue 7 years ago • 13 comments

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:- simulator screen shot - iphone 8 - 2017-10-31 at 18 48 23

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

ZalakSA avatar Oct 31 '17 13:10 ZalakSA

Have u found any solution to this ?

nandantal avatar Nov 02 '17 09:11 nandantal

yes i have this issue too, so fall bak to version 1.0.4

l12ab avatar Nov 03 '17 18:11 l12ab

+1

alexsteinerde avatar Nov 04 '17 17:11 alexsteinerde

To fix it on this version, create one UIView and add items programmatically . Don't use tableview

nandantal avatar Nov 05 '17 04:11 nandantal

It is displayed in the demo project, but where is the difference?

corin8823 avatar Nov 05 '17 13:11 corin8823

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)

salvasp avatar Nov 09 '17 07:11 salvasp

you just need to clear background of view actually

arizale avatar Nov 15 '17 09:11 arizale

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.

kramsretep avatar Nov 15 '17 21:11 kramsretep

I have same too. Also backed to 1.0.4

Maxatma avatar Nov 22 '17 10:11 Maxatma

I have the same issue, I'm using swift 4

ktinguer avatar Dec 25 '17 13:12 ktinguer

To resolve this issue i use version 1.0.4 and fix it to Swift 4

tuanmoza avatar Jan 11 '18 03:01 tuanmoza

Any luck so far with latest version?

chetan-duke avatar Jan 30 '23 10:01 chetan-duke

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

CoderFenchHU avatar Nov 06 '23 09:11 CoderFenchHU