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 not showing on top of UITextField when rightview is set #214

Open
chelvinn opened this issue Nov 5, 2020 · 1 comment
Open

Arrow not showing on top of UITextField when rightview is set #214

chelvinn opened this issue Nov 5, 2020 · 1 comment

Comments

@chelvinn
Copy link

chelvinn commented Nov 5, 2020

Hi,

I'm having this issue as shown below whereby the pop tip will not have an arrow. Below is my sample code:

    override func viewDidLoad() {
         super.viewDidLoad()
      
         self.textField.rightView = self.setupErrorToolTip()
    }

    func setupErrorToolTip() -> UIView {
        let errorButton = UIButton(frame: CGRect(x:0, y:0, width: 20, height: 20))
        errorButton.addTarget(self, action: #selector(toolTipButtonAction), for: .touchUpInside)
        errorButton.tag = 1
        errorButton.setTitle("!", for: .normal)
        errorButton.setTitleColor(.white, for: .normal)
        errorButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold)
        errorButton.backgroundColor = UIColor.red
        errorButton.layer.cornerRadius = errorButton.bounds.width/2
        
        // create the view that would act as the padding
        let rightView = UIView(frame: CGRect(
            x: 0, y: 0, width: 25, height: 25))
        rightView.contentMode = .center
        rightView.addSubview(errorButton)
        
        return rightView
    }
    
    @objc func toolTipButtonAction(sender:UIButton) {
        let popTip = PopTip()
        popTip.actionAnimation = .float(offsetX: 0, offsetY: 8)
        popTip.show(text: "Hey! Listen!", direction: .up, maxWidth: 200, in: sender, from: view.frame)
     }

Screenshot 2020-11-05 at 11 50 27 AM

@chelvinn
Copy link
Author

chelvinn commented Nov 9, 2020

@andreamazz any suggestions on this? Thanks

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

1 participant