From 235e6900ebf32699d5b46b5e4a45fdbdb7d0d19a Mon Sep 17 00:00:00 2001 From: 左丞 Date: Thu, 18 May 2017 17:38:47 +0800 Subject: [PATCH] no message --- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift | 40 +++++++++++++++++++++++++++++++++++++++- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------- YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStationViewController.swift | 2 ++ 3 files changed, 178 insertions(+), 81 deletions(-) diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift index 33e5c64..38ed465 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift +++ b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/SearchTVStationListViewController.swift @@ -10,11 +10,16 @@ import UIKit class SearchTVStationListViewController: UIViewController { var alList:[String] = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] - + var grad:[String] = ["小学","初中","高中","全部年段"] + @IBOutlet weak var downIcon: UIImageView! + @IBOutlet weak var gradName: UILabel! + @IBOutlet weak var tableView: UITableView! @IBOutlet weak var selectView: UIView! override func viewDidLoad() { super.viewDidLoad() + gradName.text = "全部年段" + tableView.tintColor = UIColor.lightGray // Do any additional setup after loading the view. } @@ -23,7 +28,28 @@ class SearchTVStationListViewController: UIViewController { // Dispose of any resources that can be recreated. } + @IBAction func selectGradClick(_ sender: UIButton) { + selectView.isHidden = false + } + + @IBAction func selectBtnClick(_ sender: UIButton) { + selectView.isHidden = true + switch sender.tag { + case 101: + break + case 102: + break + case 103: + break + case 104: + break + default: + break + } + gradName.text = grad[sender.tag-101] + } + /* // MARK: - Navigation @@ -58,6 +84,18 @@ extension SearchTVStationListViewController:UITableViewDataSource,UITableViewDel return alList.count } + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + return alList[section] + } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return 44 + } +} + +class SearchTVStationListCell: UITableViewCell { + @IBOutlet weak var stationName: UILabel! + @IBOutlet weak var tvStationImage: UIImageView! } diff --git a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard index 21ba817..70ee55c 100644 --- a/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard +++ b/YouerLiveVideo/YouerLiveVideo/controllers/TVStation/TVStation.storyboard @@ -97,15 +97,121 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +