同步操作将从 兰德网络O2OA平台软件/O2OA 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
//// O2DemoAlertView.swift// O2Platform//// Created by FancyLou on 2019年1月22日.// Copyright © 2019 zoneland. All rights reserved.//import UIKitimport CocoaLumberjackclass O2DemoAlertView: UIView {let backFrame = CGRect.init(x: 0, y: 0, width: SCREEN_WIDTH, height: SCREEN_HEIGHT)let backColor = UIColor(r: 0, g: 0, b: 0, a: 0.6)var boardView = UIView()var closeBtn = UIButton.init(type: UIButton.ButtonType.custom)func initView() -> UIView {self.frame = backFrameself.isHidden = trueself.backgroundColor = backColorreturn self}private func addBoardView() {// 公告内容放到屏幕外面let x = (SCREEN_WIDTH - 315 ) / 2self.boardView.frame = CGRect.init(x: x, y: -(SCREEN_HEIGHT), width: 315, height: 485)self.boardView.backgroundColor = UIColor.clearlet boardBackImage = UIImageView.init(frame: CGRect.init(x: 0, y: 0, width: 315, height: 485))boardBackImage.layer.masksToBounds = trueboardBackImage.contentMode = UIView.ContentMode.scaleAspectFillboardBackImage.image = UIImage(named: "pic_czsm")self.boardView.addSubview(boardBackImage)//添加公告let closeX = CGFloat(315 - 5 - 22)self.closeBtn.frame = CGRect.init(x: closeX, y: 5, width: 22, height: 22) // 关闭按钮在公告的右上角 right:5 top:5self.closeBtn.setImage(UIImage(named: "icon_off_white2"), for: UIControl.State.normal)self.closeBtn.addTarget(self, action: #selector(closeAlertView), for: UIControl.Event.touchUpInside)self.boardView.addSubview(self.closeBtn)self.closeBtn.isHidden = true //关闭按钮隐藏}func showFallDown() {UIApplication.shared.keyWindow?.addSubview(initView())self.isHidden = false //显示背景addBoardView() //添加公告self.addSubview(self.boardView)//执行动画 从上往下掉落 回弹一下let firstY = SCREEN_HEIGHT - 485let secondY = CGFloat(0.0)let lastY = (SCREEN_HEIGHT - 485) / 2UIView.animate(withDuration: 0.5, animations: {self.boardView.frame.origin.y = firstY}) { (_) inUIView.animate(withDuration: 0.2, animations: {self.boardView.frame.origin.y = secondY}, completion: { (_) inUIView.animate(withDuration: 0.2, animations: {self.boardView.frame.origin.y = lastY}, completion: { (_) inself.closeBtn.isHidden = false})})}}@objc func closeAlertView() {self.closeBtn.isHidden = trueUIView.animate(withDuration: 0.5, animations: {self.boardView.frame.origin.y = -(SCREEN_HEIGHT)}) { (_) inself.removeFromSuperview()}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。