從程式製作國旗圖案

怕熱的我想去看極光啊~~~Iceland

import UIKitlet rectA = CGRect(x: 0, y: 0, width: 250, height: 180)let backgroundView = UIView(frame: rectA)backgroundView.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 1)let rectB = CGRect(x: 0, y: 0, width: 70, height: 70)let viewB = UIView(frame: rectB)viewB.backgroundColor = UIColor(red: 0, green: 0, blue: 1, alpha: 1)backgroundView.addSubview(viewB)let rectC = CGRect(x: 0, y: 110, width: 70, height: 70)let viewC = UIView(frame: rectC)viewC.backgroundColor = UIColor(red: 0, green: 0, blue: 1, alpha: 1)backgroundView.addSubview(viewC)let rectD = CGRect(x: 110, y: 0, width: 140, height: 70)let viewD = UIView(frame: rectD)viewD.backgroundColor = UIColor(red: 0, green: 0, blue: 1, alpha: 1)backgroundView.addSubview(viewD)let rectE = CGRect(x: 110, y: 110, width: 140, height: 70)let viewE = UIView(frame: rectE)viewE.backgroundColor = UIColor(red: 0, green: 0, blue: 1, alpha: 1)backgroundView.addSubview(viewE)let rectF = CGRect(x: 80, y: 0, width: 20, height: 180)let viewF = UIView(frame: rectF)viewF.backgroundColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1)backgroundView.addSubview(viewF)let rectG = CGRect(x: 0, y: 80, width: 250, height: 20)let viewG = UIView(frame: rectG)viewG.backgroundColor = UIColor(red: 1, green: 0, blue: 0, alpha: 1)backgroundView.addSubview(viewG)

做國旗這個作業還滿有趣的~~我一步一步做雖然國旗簡單但還是想了很久@@

--

--