Commit 1ad8d9460b12117ebfc2f6b4587c68b5f1e6fe56
1 parent
e39c2d33
Exists in
parentassistant
commit
Showing
6 changed files
with
23 additions
and
39 deletions
Show diff stats
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/Grow/GrowViewController.swift
... | ... | @@ -99,7 +99,7 @@ class GrowViewController: UIViewController,UIScrollViewDelegate { |
99 | 99 | } |
100 | 100 | //设置scrollview滑动范围 |
101 | 101 | contentScrollView.contentSize = CGSize.init(width: width*CGFloat(titleArr.count), height: 0) |
102 | - contentScrollView.setContentOffset(CGPoint.init(x: 0, y: 0), animated: true) | |
102 | +// contentScrollView.setContentOffset(CGPoint.init(x: 0, y: 0), animated: true) | |
103 | 103 | } |
104 | 104 | |
105 | 105 | override func viewWillAppear(_ animated: Bool) { | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/ReportViewController.swift
... | ... | @@ -64,34 +64,15 @@ class ReportViewController: UIViewController,UITableViewDelegate,UITableViewData |
64 | 64 | recognizer.direction = UISwipeGestureRecognizerDirection.down |
65 | 65 | headView.addGestureRecognizer(recognizer) |
66 | 66 | |
67 | - calendar = CalendarView.init(frame: CGRect.init(x: 0, y: y, width: screenWidth, height: 245)) | |
67 | + calendar = CalendarView.init(frame: CGRect.init(x: 0, y: y*2, width: screenWidth, height: 245)) | |
68 | 68 | |
69 | 69 | } |
70 | 70 | |
71 | 71 | @objc func showView(){ |
72 | 72 | |
73 | 73 | calendar.showView() |
74 | -// keyWindow = UIApplication.shared.keyWindow! | |
75 | -// let backBtn = UIButton.init(frame: CGRect.init(x: 0, y: calendar.frame.origin.y+245+y, width: screenWidth, height: screenHeight)) | |
76 | -// backBtn.backgroundColor = UIColor.black | |
77 | -// backBtn.alpha = 0.4 | |
78 | -// | |
79 | -// backBtn.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) | |
80 | -// reportTable.isUserInteractionEnabled = false | |
81 | -// | |
82 | -// keyWindow.addSubview(backBtn) | |
83 | -// keyWindow.addSubview(calendar) | |
84 | -// calendar.isHidden = false | |
85 | 74 | |
86 | 75 | } |
87 | -// @objc func closeView(btn:UIButton) { | |
88 | -// | |
89 | -// reportTable.isUserInteractionEnabled = true | |
90 | -// UIView.animate(withDuration: 0.3) { | |
91 | -// btn.removeFromSuperview() | |
92 | -// self.calendar.isHidden = true | |
93 | -// } | |
94 | -// } | |
95 | 76 | override func didReceiveMemoryWarning() { |
96 | 77 | super.didReceiveMemoryWarning() |
97 | 78 | } | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/CalendarView.swift
... | ... | @@ -12,7 +12,7 @@ class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { |
12 | 12 | |
13 | 13 | var keyWindow = UIWindow() |
14 | 14 | var backBtn = UIButton() |
15 | - | |
15 | + var topBtn = UIButton() | |
16 | 16 | var weekLab = ["日","一","二","三","四","五","六"] |
17 | 17 | var firstDay = Int() |
18 | 18 | var monthDay = Int() |
... | ... | @@ -20,14 +20,13 @@ class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { |
20 | 20 | |
21 | 21 | override init(frame: CGRect) { |
22 | 22 | super.init(frame: frame) |
23 | - self.addSubview(self.collectionView) | |
24 | - collectionView.snp.makeConstraints { (maker) in | |
25 | - maker.center.equalToSuperview() | |
26 | - maker.height.width.equalToSuperview() | |
23 | + if !frame.isEmpty{ | |
24 | + self.addSubview(self.collectionView) | |
25 | + firstDay = CalendarDateManager.shared.getFirstMonthDays() | |
26 | + monthDay = CalendarDateManager.shared.getCurrentMonthDay() | |
27 | + todayDay = CalendarDateManager.shared.getTodayDate() | |
27 | 28 | } |
28 | - self.isHidden = false | |
29 | 29 | } |
30 | - | |
31 | 30 | override func layoutSubviews() { |
32 | 31 | |
33 | 32 | self.flowlayOut.itemSize = CGSize.init(width: self.bounds.size.width/7, height: 35) |
... | ... | @@ -35,7 +34,7 @@ class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { |
35 | 34 | lazy var flowlayOut = {()-> UICollectionViewFlowLayout in |
36 | 35 | //设置layout |
37 | 36 | let flowlayout = UICollectionViewFlowLayout() |
38 | - flowlayout.itemSize = CGSize.init(width: screenWidth/7, height:35) | |
37 | + flowlayout.itemSize = CGSize.init(width: self.bounds.size.width/7, height:35) | |
39 | 38 | flowlayout.minimumLineSpacing = 0 |
40 | 39 | flowlayout.minimumInteritemSpacing = 0 |
41 | 40 | flowlayout.headerReferenceSize = CGSize.init(width: 0, height: 0) |
... | ... | @@ -46,7 +45,7 @@ class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { |
46 | 45 | |
47 | 46 | lazy var collectionView = {()-> UICollectionView in |
48 | 47 | |
49 | - let calendarView = UICollectionView.init(frame: frame, collectionViewLayout: flowlayOut) | |
48 | + let calendarView = UICollectionView.init(frame: self.bounds, collectionViewLayout: flowlayOut) | |
50 | 49 | calendarView.delegate = self |
51 | 50 | calendarView.dataSource = self |
52 | 51 | calendarView.backgroundColor = UIColor.white |
... | ... | @@ -59,27 +58,32 @@ class CalendarView: UIView,UICollectionViewDelegate,UICollectionViewDataSource { |
59 | 58 | func showView(){ |
60 | 59 | |
61 | 60 | let key = UIApplication.shared.keyWindow! |
61 | + | |
62 | + let top = UIButton.init(frame: CGRect.init(x: 0, y: 0, width: self.bounds.size.width, height: self.frame.origin.y)) | |
63 | + top.backgroundColor = UIColor.clear | |
64 | + top.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) | |
65 | + | |
62 | 66 | let back = UIButton.init(frame: CGRect.init(x: 0, y: self.bounds.size.height, width: screenWidth, height: screenHeight)) |
63 | 67 | back.backgroundColor = UIColor.black |
64 | 68 | back.alpha = 0.4 |
65 | - | |
66 | 69 | back.addTarget(self, action: #selector(closeView(btn:)), for: UIControlEvents.allEvents) |
67 | 70 | |
71 | + key.addSubview(top) | |
68 | 72 | key.addSubview(back) |
69 | 73 | key.addSubview(self) |
74 | + | |
70 | 75 | self.isHidden = false |
71 | 76 | keyWindow = key |
72 | 77 | backBtn = back |
73 | - self.snp.makeConstraints { (maker) in | |
74 | - maker.center.equalTo(self) | |
75 | - maker.height.width.equalTo(self) | |
76 | - } | |
78 | + topBtn = top | |
79 | + | |
77 | 80 | } |
78 | 81 | //MARK: - 关闭视图 |
79 | 82 | @objc func closeView(btn:UIButton) { |
80 | 83 | |
81 | 84 | UIView.animate(withDuration: 0.3) { |
82 | 85 | self.backBtn.removeFromSuperview() |
86 | + self.topBtn.removeFromSuperview() | |
83 | 87 | self.keyWindow = UIWindow.init() |
84 | 88 | self.isHidden = true |
85 | 89 | } | ... | ... |
ParentAssistant/ParentAssistant/Classes/controllers/Information/Controller/InformationViewController.swift
... | ... | @@ -46,7 +46,7 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
46 | 46 | self.navigationItem.backBarButtonItem = item |
47 | 47 | |
48 | 48 | drawTopUI() |
49 | - | |
49 | + self.getDataFromNet() | |
50 | 50 | } |
51 | 51 | override func viewWillAppear(_ animated: Bool) { |
52 | 52 | super.viewWillAppear(animated) |
... | ... | @@ -62,7 +62,6 @@ class InformationViewController: UIViewController,UISearchBarDelegate { |
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
65 | - self.getDataFromNet() | |
66 | 65 | } |
67 | 66 | func drawTopUI(){ |
68 | 67 | ... | ... |
ParentAssistant/ParentAssistant/Supporting Files/Info.plist
... | ... | @@ -43,11 +43,11 @@ |
43 | 43 | <array> |
44 | 44 | <string>armv7</string> |
45 | 45 | </array> |
46 | + <key>UIStatusBarStyle</key> | |
47 | + <string>UIStatusBarStyleLightContent</string> | |
46 | 48 | <key>UISupportedInterfaceOrientations</key> |
47 | 49 | <array> |
48 | 50 | <string>UIInterfaceOrientationPortrait</string> |
49 | - <string>UIInterfaceOrientationLandscapeLeft</string> | |
50 | - <string>UIInterfaceOrientationLandscapeRight</string> | |
51 | 51 | </array> |
52 | 52 | <key>UISupportedInterfaceOrientations~ipad</key> |
53 | 53 | <array> | ... | ... |