mardi 5 juillet 2016

how to make border color only in the circle UIButton top?

I'm making center circle UIButton in UITabBarController. I need to paint the border color only where UIButton comes out of the tabBar border. How can I make it? We need border color only there https://monosnap.com/file/7MDqGzpUdIbClvnAvAiY2kJYKUro7z

I made the UIButton like

       private func setupLifelineButton() {
        let lifelineButton = UIButton(frame: CGRect(x: 0, y: 0, width: 64, height: 64))
        var lifelineButtonFrame = lifelineButton.frame
        lifelineButtonFrame.origin.y = view.bounds.height - lifelineButtonFrame.height - 13 // default without 13
        lifelineButtonFrame.origin.x = view.bounds.width / 2 - lifelineButtonFrame.size.width / 2
        lifelineButton.frame = lifelineButtonFrame

//        lifelineButton.backgroundColor = .redColor()
        lifelineButton.layer.cornerRadius = lifelineButtonFrame.height / 2
        lifelineButton.layer.borderWidth = 0.5
        lifelineButton.layer.borderColor = ColorManager.tabBarLayerColor.CGColor//UIColor.blackColor().CGColor

        lifelineButton.addTarget(self, action: #selector(menuButtonAction), forControlEvents: .TouchUpInside)

        // icon 

//        lifelineButton.setImage(UIImage(named: "LifeLineBarButtonIcon"), forState: .Normal)

        self.view.addSubview(lifelineButton)
        self.view.layoutIfNeeded()
    }

UPDATE: I need to remove the bottom half of the border color

Aucun commentaire:

Enregistrer un commentaire