import UIKit
class ViewController: UIViewController {
@IBOutlet var Label: UILabel!
@IBOutlet weak var whiteboxselector: UIImageView!
@IBOutlet var profilebutton: UIImageView!
@IBOutlet var friendsbutton: UIImageView!
@IBOutlet var smallcircle: UIImageView!
// These are my outlets
override func viewDidLoad() {
super.viewDidLoad()
Label.text = "Loaded"
print("Loaded")
// This is the line that runs but doesn't do anything
whiteboxselector.center = self.friendsbutton.center
}
}
有誰能告訴我爲什麼?爲什麼在viewDidLoad()中設置UIimage的.center沒有可見的效果?
腳本與否,使用camelcase快速明確指出,請參閱:https://swift.org/documentation/api-design-guidelines /。它明確指出:「遵循大小寫約定,類型和協議的名稱是UpperCamelCase,其他所有內容都是lowerCamelCase。」 – ingconti