iOSDropDown icon indicating copy to clipboard operation
iOSDropDown copied to clipboard

ArrowColor not working

Open TriDivide opened this issue 5 years ago • 4 comments

I am trying to change the color of the arrow from default (black) to white. In the interface builder, I set it to white but it stays black. I set it in code, but it stays black. I even go into the iOSDropDown.swift file and manually set the color to UIColor.white.cgColor but that doesn't do anything either. I have read that apparently the frame needs to be set but the Path has that already. Any thoughts on what is wrong?

Here is the draw code from iOS DropDown with the change: `
override func draw(_ rect: CGRect) {

    // Get size
    let size = self.layer.frame.width

    // Create path
    let bezierPath = UIBezierPath()

    // Draw points
    let qSize = size/4

    bezierPath.move(to: CGPoint(x: 0, y: qSize))
    bezierPath.addLine(to: CGPoint(x: size, y: qSize))
    bezierPath.addLine(to: CGPoint(x: size/2, y: qSize*3))
    bezierPath.addLine(to: CGPoint(x: 0, y: qSize))
    bezierPath.close()

    // Mask to path
    let shapeLayer = CAShapeLayer()
    shapeLayer.path = bezierPath.cgPath
    shapeLayer.fillColor = UIColor.white.cgColor //arrowColor.cgColor
    shapeLayer.strokeColor = UIColor.white.cgColor
    if #available(iOS 12.0, *) {
        self.layer.addSublayer (shapeLayer)
    } else {
        self.layer.mask = shapeLayer
    }
}`

TriDivide avatar Jun 04 '19 09:06 TriDivide

try Product > Clean Build Folder then start Project again it's work

ibrahimmorghim avatar Jun 09 '19 06:06 ibrahimmorghim

Have tried cleaning the build folder and then restarting the project, but it did not worked.

niveetom avatar Jul 02 '19 06:07 niveetom

Unable to change Arrow colour through Attribute inspecter

sravesh avatar Jul 14 '19 12:07 sravesh

update Your pod, issue fixed

jriosdev avatar Jul 15 '19 08:07 jriosdev