2016年10月20日 星期四

swift3 Day6 UILabel 創造與移除 add remove

要用 UILabel ,



在 Controller 中寫,不在 storyboard 中直接拉的話,



要記得加



self.view.addSubview(testLabel)



可以寫在 button 中,就會再按下後才看到



 



UILabel 消失(對於指定的 UIView 都會消失 ):



testLabel.removeFromSuperview()



 



Expected declaration error 



把出錯的那行加到 function 中!






0 意見:

張貼留言