草庐IT

blackButton

全部标签

ios - 更改 ViewController Swift 的背景颜色? (单 View 应用程序)

我正在使用Swift(XCode6.2)制作一个非常简单的单View应用程序,它包含2个按钮“blackButton”和“whiteButton”。单击blackButton后,它会将View的背景颜色更改为黑色,单击whiteButton后,它会将背景更改为白色。谁能建议任何可能的方法来做到这一点?ViewController.swift://beginningimportUIKitclassViewController:UIViewController{@IBActionfuncblackButton(sender:AnyObject){}@IBActionfuncwhiteBut

ios - 更改 ViewController Swift 的背景颜色? (单 View 应用程序)

我正在使用Swift(XCode6.2)制作一个非常简单的单View应用程序,它包含2个按钮“blackButton”和“whiteButton”。单击blackButton后,它会将View的背景颜色更改为黑色,单击whiteButton后,它会将背景更改为白色。谁能建议任何可能的方法来做到这一点?ViewController.swift://beginningimportUIKitclassViewController:UIViewController{@IBActionfuncblackButton(sender:AnyObject){}@IBActionfuncwhiteBut