我正在使用 EasyTipView 創建一個自定義提示視圖,里面有一個按鈕,如下圖所示。但是當我點擊提示視圖內的按鈕時沒有任何反應。有沒有人使用過這個庫并且知道如何解決這個問題?
我的演示:github.com/minhtien1403/TestTipView
庫鏈接:
視圖層次結構很好,沒有覆寫按鈕

uj5u.com熱心網友回復:
從您的 github 演示中,我注意到里面的按鈕點擊不起作用。
首先,CustomTipView當您更改位置時,您會呼叫translatesAutoresizingMaskIntoConstraints重新定義視圖,這會使 xib 不再正常作業。只需要洗掉這個
fileprivate func arrange(withinSuperview superview: UIView) {
// your others code
if case .view(let contentView) = content {
contentView.translatesAutoresizingMaskIntoConstraints = false // remove this
contentView.frame = getContentRect(from: getBubbleFrame())
}
// your others code
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/516903.html
標籤:IOS迅速
