当前位置: 首页 > news >正文

辛集市网站建设_网站建设公司_网站开发_seo优化

厦门无忧网站建设有限公司,企业网站的种类,浙江省门户网站,wordpress小工具里页面1.创建趣味问答App项目 2.创建一个问题文本#xff0c;水平居中约束。 创建蓝、红两个按钮#xff0c;放入Stack View中#xff0c;给StackView水平居中约束#xff0c;下边约束#xff0c;设置两按钮间距为20. 设置进度条view与safe View关系为equal width。设置他们的比… 1.创建趣味问答App项目  2.创建一个问题文本水平居中约束。 创建蓝、红两个按钮放入Stack View中给StackView水平居中约束下边约束设置两按钮间距为20.  设置进度条view与safe View关系为equal width。设置他们的比例为113.  3.为系统增加深色模式适配(仅限iOS13以上版本) 为Assets中新增新的颜色配置。  分别为浅色和深色设置颜色。  选中所有文字设置为名叫Color的颜色。  效果  4.利用MVC思想编码。 创建新.swift文件Question.swift: import Foundationclass Question {var text: Stringvar answer: Boolinit(text: String, answer: Bool){self.text textself.answer answer} }let queastions [Question(text: 马云是世界首富, answer: false),Question(text: 刘强东最早是在中关村卖光盘的, answer: true),Question(text: 苹果可以吃, answer: true),Question(text: 只要坚持下去就能学好代码, answer: true),Question(text: 王思聪是80后, answer: true),Question(text: 在国内可以正常访问google, answer: false),Question(text: 敲完一万行代码可以变身编程高手, answer: true),Question(text: 撒贝宁说清华还行, answer: false),Question(text: 一直学习变大牛, answer: true),Question(text: 安卓也很好使, answer: true),Question(text: 优酷比b站牛, answer: false),Question(text: 上班可以摸鱼吗, answer: false),Question(text: 这狗iOS系统真的没windows好用啊, answer: true) ]ViewController.swift: import UIKitclass ViewController: UIViewController {var questionIndex 0IBOutlet weak var questionLabel: UILabel!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view, typically from a nib.questionLabel.text queastions[0].text}IBAction func answerPressed(_ sender: UIButton) {if sender.tag 1 {if queastions[questionIndex].answer true{print(huidazhengque)}else{print(huidacuowu)}}else{if queastions[questionIndex].answer true{print(huidacuowu)}else{print(huidazhengque)}}questionIndex 1if questionIndex 12{questionLabel.text queastions[questionIndex].text}else{questionIndex 0}}override func didReceiveMemoryWarning() {super.didReceiveMemoryWarning()// Dispose of any resources that can be recreated.} }5.创建弹窗 ViewController.swift: import UIKitclass ViewController: UIViewController {var questionIndex 0IBOutlet weak var questionLabel: UILabel!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view, typically from a nib.questionLabel.text queastions[0].text}IBAction func answerPressed(_ sender: UIButton) {if sender.tag 1 {if queastions[questionIndex].answer true{print(huidazhengque)}else{print(huidacuowu)}}else{if queastions[questionIndex].answer true{print(huidacuowu)}else{print(huidazhengque)}}questionIndex 1if questionIndex 12{questionLabel.text queastions[questionIndex].text}else{let alert UIAlertController(title: 漂亮, message: 您已经完成了所有问题要再来一遍吗, preferredStyle: .alert)alert.addAction(UIAlertAction(title: 再来一遍, style: .default, handler: { _ in}))self.present(alert, animated: true)}}override func didReceiveMemoryWarning() {super.didReceiveMemoryWarning()// Dispose of any resources that can be recreated.} }6.启动测试  7.完善再来一遍整理代码。 ViewController.swift: import UIKitclass ViewController: UIViewController {var questionIndex 0IBOutlet weak var questionLabel: UILabel!override func viewDidLoad() {super.viewDidLoad()// Do any additional setup after loading the view, typically from a nib.questionLabel.text queastions[0].text}IBAction func answerPressed(_ sender: UIButton) {if sender.tag 1 {if queastions[questionIndex].answer true{print(huidazhengque)}else{print(huidacuowu)}}else{if queastions[questionIndex].answer true{print(huidacuowu)}else{print(huidazhengque)}}questionIndex 1nextQuestion()}func nextQuestion(){if questionIndex 12{questionLabel.text queastions[questionIndex].text}else{questionIndex 0let alert UIAlertController(title: 漂亮, message: 您已经完成了所有问题要再来一遍吗, preferredStyle: .alert)let action UIAlertAction(title: 再来一遍, style: .default, handler: { _ inself.questionLabel.text queastions[0].text})alert.addAction(action)//present(alert, animated: true)}}override func didReceiveMemoryWarning() {super.didReceiveMemoryWarning()// Dispose of any resources that can be recreated.}}
http://www.lebaoying.cn/news/108905.html

相关文章:

  • 新民电商网站建设价格咨询wordpress修改菜单栏
  • wordpress html地图网站优化排名易下拉霸屏
  • 产品宣传册设计网站建设wordpress 个人资料
  • 重庆南川网站制作价格企业所得税分录
  • 自贡建设能源开发有限公司网站西安建设和住房保障局网站
  • 网站赚钱吗英文营销网站 知乎
  • 做网站竞价怎么找客户第三方关键词优化排名
  • 万家建设有限公司网站做环保工程常用的网站
  • 做牛排的网站企业常用系统
  • 商丘网站设计有没有专门交人做美食的视频网站
  • 如何做擦边球网站网站分几类
  • 做网站 当站长汕头网站建设推荐
  • 休闲旅游网站建设郑东新区网站建设
  • winxp下做网站提升审美网站
  • 网站建设中 显示杭州专业做网站的
  • 网站如何做淘宝联盟推广网站建设错误要点
  • 广西两学一做考试网站有域名就可以做网站么
  • 摄影网站建设目的苏州做企业网站
  • 广东微信网站制作价格网站建议公司
  • 手机建网站惠州做网站优化
  • 网站源码和模板营销运营平台
  • 具有价值的广州做网站网站建设小知识
  • app展示网站模板html5温州市建设局网站
  • php网站中水印怎么做的wordpress页面去空行
  • 天津做无痛人流费用五洲网站网站建设与管理报告
  • 网站建设用什么写大企业网站制作及维护
  • 宝安中心医院是三甲医院吗南宁庄关键词推广优化方案
  • 注册的空间网站合肥需要做网站的公司
  • 网站整套模板项目代码下载wordpress建站安全性
  • 网站开发项目实例WordPress搬家文章404