Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrow Missing #101

Open
syedrazackimran opened this issue Jan 3, 2018 · 5 comments
Open

Arrow Missing #101

syedrazackimran opened this issue Jan 3, 2018 · 5 comments

Comments

@syedrazackimran
Copy link

I tried to implement ur pod but I'm facing some issues. Arrow point is missing kindly do needfully, I added screen and codes check it

var popOverOptions : [PopoverOption] = [ .type(.down), .springDamping(0.7), .initialSpringVelocity(3.0), .cornerRadius(6.0), .blackOverlayColor(UIColor(white: 0.0, alpha: 0.6)), .sideEdge(20.0), .arrowSize(CGSize(width: 12, height: 6)) ]

let startPoint = CGPoint(x: self.view.bounds.width - 60 , y: 55 ) let tableView = UITableView(frame: CGRect(x: 0, y: 0, width: Int(self.view.frame.width - 40) , height: 42 * self.options.count)) tableView.delegate = self tableView.dataSource = self tableView.isScrollEnabled = false tableView.tableFooterView = UIView() self.popover = Popover(options: self.popOverOptions) self.popover.show(tableView, point: startPoint) return

simulator screen shot - iphone 6 - 2018-01-03 at 16 34 54

@tuanmoza
Copy link

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

@mdflores
Copy link

Same here seems the arrow is not showing.. Using Popover (1.2.0)

let customPopoverView = CustomPopover.instanceFromNib() customPopoverView.frame = CGRect(origin: startingPoint, size: defaultFrameSize) let options = [ .type(.down), .animationIn(0.3), .color(primaryTint), .arrowSize(CGSize(width: 16.0, height: 10.0)) ] as [PopoverOption] let tooltip = Popover(options: options, showHandler: nil, dismissHandler: nil) tooltip.show(customPopoverView, point: startingPoint)

@romitmewada
Copy link

I found a temporary solution. Arrow is below view you added

let aView = UIView(frame: CGRect(x: 0, y: 0, width: width, height: 180))

let myViewObject = ////get instance
myViewObject.frame = CGRect.init(x: 0, y: 10, width:width, height: 170)
aView.addSubview(myViewObject)

popover.show(aView, point: startPoint)

Hope this is helpful for someone.

@Cu-Toof
Copy link

Cu-Toof commented Jun 20, 2019

Just remove a below code in Popover file:

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

Because the code is set frame's contentView that is equal frame's superview, and not space for drawing arrow.

@CoderFenchHU
Copy link

CoderFenchHU commented Nov 7, 2023

override open func draw(_ rect: CGRect) {
 ...
 
    color.setFill()
    //        arrow.fill()
    let maskLayer = CAShapeLayer()
    maskLayer.path = arrow.cgPath
    self.layer.mask = maskLayer
}

Use mask layer replace fill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants