import UIKit
import DynamicButton
class Viola: UIViewController
{
@IBOutlet weak var dynamicButton: UIButton!
let dynamicButton = DynamicButton(style: DynamicButtonStyle.hamburger)
//var confettiView: SAConfettiView!
override func viewDidLoad() {
super.viewDidLoad()
let dynamicButton = DynamicButton()
dynamicButton.lineWidth = 3
dynamicButton.strokeColor = .white
dynamicButton.highlightStokeColor = .gray
dynamicButton.style = DynamicButtonStyle.hamburger
dynamicButton.setStyle(DynamicButtonStyle.close, animated: true)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
//dynamicButton.style = DynamicButtonStyle.hamburger
}
}
答案 0 :(得分:0)
我没有使用过那个库,但很明显你创建了DynamicButton
三次。我认为您应该首先确定使用哪个按钮。
例如,只做这件事会发生什么?
override func viewDidLoad() {
super.viewDidLoad()
let dynamicButton = DynamicButton(style: DynamicButtonStyle.hamburger)
dynamicButton.lineWidth = 3
dynamicButton.strokeColor = .white
dynamicButton.highlightStokeColor = .gray
self.view.addSubview(dynamicButton)
}