我想做一個按鈕,但沒有做任何事情會使它出現在屏幕上。我已經看過很多其他職位,但這些職位對我來說沒有任何建議。任何幫助將非常感激。創建一個UIButton
/*BUTTON: Start button*/
let startButton = UIButton(type: .RoundedRect)
startButton.setTitle("Start", forState: UIControlState.Normal)
startButton.center = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame)-50)
startButton.backgroundColor = UIColor.blackColor()
startButton.setBackgroundImage(UIImage(named: "Imaginary Inc Logo"), forState: UIControlState.Normal)
self.view!.addSubview(startButton)
的可能的複製[如何編程創建基本的UIButton?( http://stackoverflow.com/questions/1378765/how-do-i-create-a-basic-uibutton-programmatically) –