andreamazz / andreamazz/AMPopTip

Arrow not showing on top of UITextField when rightview is set

Aperta
#214 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Swift
Stelle
3.3k
Fork
449
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi,

I'm having this issue as shown below whereby the pop tip will not have an arrow. Below is my sample code:
```swift
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](https://user-images.githubusercontent.com/61046241/98195668-42ea4100-1f5d-11eb-85c9-5f6fd7e72c5a.png)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.