Commit 1c8b61ab61572b4bf2bda48ef560608b783d30ae

Authored by Cao yang
1 parent 7273edbf
Exists in parentassistant

页面布局优化

Showing 15 changed files with 24 additions and 24 deletions   Show diff stats
ParentAssistant/ParentAssistant.xcworkspace/xcuserdata/caoyang.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/MoralViewController.swift
... ... @@ -69,7 +69,7 @@ class MoralViewController: UIViewController,UITableViewDelegate,UITableViewDataS
69 69 case 0:
70 70 return 240
71 71 case 1:
72   - return 280
  72 + return screenWidth*0.62
73 73 case 2:
74 74 return 70
75 75 default:
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/Report/SceneDetailViewController.swift
... ... @@ -45,7 +45,7 @@ class SceneDetailViewController: UIViewController,UITableViewDataSource,UITableV
45 45 case 0:
46 46 return 240
47 47 case 1:
48   - return 300
  48 + return screenWidth*0.62
49 49 case 2:
50 50 return 70
51 51 default:
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramView/GrowCheckDownTableViewCell.swift
... ... @@ -16,7 +16,7 @@ class GrowCheckDownTableViewCell: UITableViewCell {
16 16 override func awakeFromNib() {
17 17 super.awakeFromNib()
18 18 // Initialization code
19   - self.backgroundColor = backgroundColor
  19 + self.backgroundColor = backGroundColor
20 20 }
21 21  
22 22 func setCellData(model:StudentCardModel){
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramView/ProgramVacateBodyTableViewCell.swift
... ... @@ -19,7 +19,7 @@ class ProgramVacateBodyTableViewCell: UITableViewCell {
19 19 @IBOutlet weak var vacateResult: UILabel!
20 20 override func awakeFromNib() {
21 21 super.awakeFromNib()
22   - self.backgroundColor = backgroundColor
  22 + self.backgroundColor = backGroundColor
23 23  
24 24 // Initialization code
25 25 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ProgramView/ProgramVacateTableViewCell.swift
... ... @@ -15,7 +15,7 @@ class ProgramVacateTableViewCell: UITableViewCell {
15 15 @IBOutlet weak var endTime: UILabel!
16 16 override func awakeFromNib() {
17 17 super.awakeFromNib()
18   - self.backgroundColor = backgroundColor
  18 + self.backgroundColor = backGroundColor
19 19  
20 20 // Initialization code
21 21 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/BehaviorDetailCell.swift
... ... @@ -12,7 +12,7 @@ class BehaviorDetailCell: UITableViewCell {
12 12  
13 13 override func awakeFromNib() {
14 14 super.awakeFromNib()
15   - self.backgroundColor = backgroundColor
  15 + self.backgroundColor = backGroundColor
16 16  
17 17 // Initialization code
18 18 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/EducationDetailCell.swift
... ... @@ -14,11 +14,10 @@ class EducationDetailCell: UITableViewCell {
14 14  
15 15 override func awakeFromNib() {
16 16 super.awakeFromNib()
17   - self.backgroundColor = backgroundColor
18   -
19   - let rect = CGRect.init(x: 10, y: 60, width: screenWidth-20, height: self.bounds.size.height-60)
20   - customLineChart = LineChartView.init(frame: rect)
  17 + self.backgroundColor = backGroundColor
21 18  
  19 + let rect = CGRect.init(x: 10, y: 60, width: screenWidth-20, height: screenWidth*0.62-60)
  20 + customLineChart = LineChartView.init(frame: rect)
22 21 print("linechart frame = \(customLineChart.frame)")
23 22 customLineChart.drawUI(xLableArr: nil)
24 23 let arr1 = [4,4,2,1,3]
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/GrowSubjectCell.swift
... ... @@ -12,7 +12,7 @@ class GrowSubjectCell: UITableViewCell {
12 12  
13 13 override func awakeFromNib() {
14 14 super.awakeFromNib()
15   - self.backgroundColor = backgroundColor
  15 + self.backgroundColor = backGroundColor
16 16  
17 17 // Initialization code
18 18 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/LineChartView.swift
... ... @@ -39,7 +39,8 @@ class LineChartView: UIView {
39 39 override init(frame: CGRect) {
40 40 super.init(frame: frame)
41 41 if !frame.isEmpty {
42   - self.yCellHeight = self.bounds.size.height/(CGFloat(yCount)+1)
  42 + //留点空间放横坐标按钮
  43 + self.yCellHeight = (frame.size.height-30)/(CGFloat(yCount))
43 44 }
44 45 }
45 46 func drawUI(xLableArr:Array<String>?){
... ... @@ -61,7 +62,7 @@ class LineChartView: UIView {
61 62 yLab.font = UIFont.systemFont(ofSize: 14)
62 63 self.addSubview(yLab)
63 64  
64   - let lineLab = UILabel.init(frame: CGRect.init(x: 40, y: yLab.center.y, width: self.bounds.size.width-80, height: 0.4))
  65 + let lineLab = UILabel.init(frame: CGRect.init(x: 40, y: yLab.center.y, width: self.bounds.size.width-50, height: 0.4))
65 66 lineLab.backgroundColor = UIColorWithRGB(R: 190, G: 190, B: 190)
66 67 self.addSubview(lineLab)
67 68  
... ... @@ -73,7 +74,7 @@ class LineChartView: UIView {
73 74 private func drawX() {
74 75 let xWidth = (self.bounds.size.width)/CGFloat(yCount)
75 76 for index in 0..<xCount {
76   - let nameBtn = UIButton.init(frame: CGRect.init(x: xWidth+CGFloat(index)*xWidth, y: yCellHeight*6-10, width: 40, height: 30))
  77 + let nameBtn = UIButton.init(frame: CGRect.init(x: xWidth+CGFloat(index)*xWidth, y: yCellHeight*CGFloat(yCount-1)+20, width: 40, height: 30))
77 78 nameBtn.setTitle(xLabArr[index], for: UIControlState.normal)
78 79 nameBtn.setTitleColor(UIColorWithRGB(R: 119, G: 119, B: 119), for: UIControlState.normal)
79 80 nameBtn.titleLabel!.textAlignment = .center
... ... @@ -82,7 +83,7 @@ class LineChartView: UIView {
82 83 // nameBtn.backgroundColor = UIColor.orange
83 84 self.addSubview(nameBtn)
84 85  
85   - nameBtn.addTarget(self, action: #selector(touchXAction(tap:)), for: UIControlEvents.touchUpInside)
  86 + nameBtn.addTarget(self, action: #selector(touchXAction(tap:)), for: UIControlEvents.touchDown)
86 87  
87 88 xCenterArr.append(nameBtn.frame.origin.x+20)
88 89 }
... ... @@ -123,15 +124,15 @@ class LineChartView: UIView {
123 124 //X轴下划线
124 125 let movePath = CGMutablePath()
125 126 movePath.move(to: CGPoint.init(x: xCenterArr[index], y: yCenterArr[0]))
126   - movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+5*(self.bounds.height/(CGFloat(yCount)+1))))
  127 + movePath.addLine(to: CGPoint.init(x: xCenterArr[index], y: 10+CGFloat(yCount-1)*yCellHeight))
127 128 lineLayer.path = movePath
128 129  
129 130 xMoveLayer.strokeColor = UIColorWithRGB(R: 92, G: 145, B: 230).cgColor
130 131 xMoveLayer.lineWidth = 2
131 132 self.layer.addSublayer(xMoveLayer)
132 133 let movePath2 = CGMutablePath()
133   - movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: yCellHeight*6+20))
134   - movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: yCellHeight*6+20))
  134 + movePath2.move(to: CGPoint.init(x: xCenterArr[index]-15, y: yCellHeight*CGFloat(yCount-1)+20+30))
  135 + movePath2.addLine(to: CGPoint.init(x: xCenterArr[index]+15, y: yCellHeight*CGFloat(yCount-1)+20+30))
135 136 xMoveLayer.path = movePath2
136 137  
137 138 if yLabArray.count == dateArr.count {
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/MoralDetailCell.swift
... ... @@ -20,7 +20,7 @@ class MoralDetailCell: UITableViewCell {
20 20 @IBOutlet weak var evaluationLab: UILabel!
21 21 override func awakeFromNib() {
22 22 super.awakeFromNib()
23   - self.backgroundColor = backgroundColor
  23 + self.backgroundColor = backGroundColor
24 24  
25 25 // Initialization code
26 26 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/MoralTableViewCell.swift
... ... @@ -18,7 +18,7 @@ class MoralTableViewCell: UITableViewCell {
18 18 @IBOutlet weak var reportDateLab: UILabel!
19 19 override func awakeFromNib() {
20 20 super.awakeFromNib()
21   - self.backgroundColor = backgroundColor
  21 + self.backgroundColor = backGroundColor
22 22  
23 23 // Initialization code
24 24 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/SceneDownCell.swift
... ... @@ -18,7 +18,7 @@ class SceneDownCell: UITableViewCell {
18 18 @IBOutlet weak var dateLab: UILabel!
19 19 override func awakeFromNib() {
20 20 super.awakeFromNib()
21   - self.backgroundColor = backgroundColor
  21 + self.backgroundColor = backGroundColor
22 22  
23 23 // Initialization code
24 24 }
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/SceneMiddleCell.swift
... ... @@ -13,10 +13,10 @@ class SceneMiddleCell: UITableViewCell {
13 13 var customLineChart = LineChartView()
14 14 override func awakeFromNib() {
15 15 super.awakeFromNib()
16   - self.backgroundColor = backgroundColor
  16 + self.backgroundColor = backGroundColor
17 17  
18 18 // Initialization code
19   - let rect = CGRect.init(x: 0, y: 60, width: screenWidth-20, height: self.bounds.size.height-60)
  19 + let rect = CGRect.init(x: 20, y: 60, width: screenWidth-40, height: screenWidth*0.62-60)
20 20 customLineChart = LineChartView.init(frame: rect)
21 21 let customXLabArr = ["03/12","03/13","03/14","03/15","03/16"]
22 22  
... ...
ParentAssistant/ParentAssistant/Classes/controllers/Grow/View/ReportView/SceneTopCell.swift
... ... @@ -16,7 +16,7 @@ class SceneTopCell: UITableViewCell {
16 16 @IBOutlet weak var SuggestLab: UITextView! //指导意见
17 17 override func awakeFromNib() {
18 18 super.awakeFromNib()
19   - self.backgroundColor = backgroundColor
  19 + self.backgroundColor = backGroundColor
20 20  
21 21 // Initialization code
22 22 }
... ...