| | |
| | | // |
| | | |
| | | import UIKit |
| | | import Lantern |
| | | |
| | | class HomeListenFight_lesson_3_VC: BaseVC { |
| | | |
| | |
| | | } |
| | | |
| | | @objc private func fullscreenAction(btn:UIButton){ |
| | | print("全屏:\(btn.tag)") |
| | | |
| | | var answerView:Lesson_3_AnswerView! |
| | | for (_,v) in (stackView.arrangedSubviews as! [Lesson_3_AnswerView]).enumerated(){ |
| | | if v.btn_fullscreen.tag == btn.tag{ |
| | | answerView = v;break |
| | | } |
| | | } |
| | | |
| | | |
| | | let lantern = Lantern() |
| | | lantern.numberOfItems = { () in |
| | | return 1 |
| | | } |
| | | |
| | | lantern.cellClassAtIndex = { _ in |
| | | LanternImageCell.self |
| | | } |
| | | |
| | | |
| | | lantern.transitionAnimator = LanternZoomAnimator(previousView: { index -> UIView? in |
| | | return answerView.img_cover |
| | | }) |
| | | |
| | | |
| | | // UIPageIndicator样式的页码指示器 |
| | | lantern.pageIndicator = LanternDefaultPageIndicator() |
| | | |
| | | lantern.pageIndex = 0 |
| | | |
| | | lantern.reloadCellAtIndex = { context in |
| | | let lanternCell = context.cell as? LanternImageCell |
| | | lanternCell?.imageView.image = answerView.img_cover.image |
| | | } |
| | | //不要使用push |
| | | lantern.show() |
| | | } |
| | | } |
| | | |