【文件属性】:
文件名称:UIKit学习
文件大小:1.06MB
文件格式:ZIP
更新时间:2021-02-20 18:33:58
Swift
项目2
以下内容我随便写写
初始的UIViewController可以直接嵌入UINavigationController
UIView之间可以控制+拖动的方式在各个视图之间设置相对位置,居中之类的
UIButton通过连接的方式可以设置onTap。直接拖动到连接函数。
多个UIButton连接同一个函数,可以通过设置每个UIButton的标签分开。
@IBAction func buttonTapped ( _ sender : UIButton) {
var title: String
if sender. tag == correctAnswer {
title = " Correct "
score += 1
} else {
title = " Wrong "
score -= 1
}
}
UIAlartController使