Commit 73dc79a7392ccf3d3b2765f40b92c9784cc58ce8
1 parent
a4f6f9ad
单大图cell复用问题 , tabbar图片设置为original
Showing
10 changed files
with
32 additions
and
12 deletions
metaCode/Classes/Common/Base/CNLiveBaseTabBarViewController.swift
| @@ -39,7 +39,7 @@ class CNLiveBaseTabBarViewController: UITabBarController | @@ -39,7 +39,7 @@ class CNLiveBaseTabBarViewController: UITabBarController | ||
| 39 | // override func viewWillAppear(_ animated: Bool) { | 39 | // override func viewWillAppear(_ animated: Bool) { |
| 40 | // super.viewWillAppear(animated) | 40 | // super.viewWillAppear(animated) |
| 41 | // | 41 | // |
| 42 | -// self.selectedIndex = 1 | 42 | +// self.selectedIndex = 0 |
| 43 | // | 43 | // |
| 44 | // } | 44 | // } |
| 45 | override func viewDidAppear(_ animated: Bool) { | 45 | override func viewDidAppear(_ animated: Bool) { |
| @@ -63,17 +63,15 @@ class CNLiveBaseTabBarViewController: UITabBarController | @@ -63,17 +63,15 @@ class CNLiveBaseTabBarViewController: UITabBarController | ||
| 63 | let mineVC = CNLiveMineViewController() | 63 | let mineVC = CNLiveMineViewController() |
| 64 | 64 | ||
| 65 | creatTabbarView(viewController: homeVC, image: "tabbar_hoem_icon_default", selectImage: "tabbar_hoem_icon_selected", title: "首页") | 65 | creatTabbarView(viewController: homeVC, image: "tabbar_hoem_icon_default", selectImage: "tabbar_hoem_icon_selected", title: "首页") |
| 66 | - | ||
| 67 | creatTabbarView(viewController: authVC, image: "tabbar_authentication_unSelect", selectImage: "tabbar_authentication", title: "认证") | 66 | creatTabbarView(viewController: authVC, image: "tabbar_authentication_unSelect", selectImage: "tabbar_authentication", title: "认证") |
| 68 | - | ||
| 69 | creatTabbarView(viewController: mineVC, image: "tabbar_mine_icon_default", selectImage: "tabbar_mine_icon_selected", title: "我的") | 67 | creatTabbarView(viewController: mineVC, image: "tabbar_mine_icon_default", selectImage: "tabbar_mine_icon_selected", title: "我的") |
| 70 | 68 | ||
| 71 | self.tabBar.tintColor = UIColor("#0066FE") | 69 | self.tabBar.tintColor = UIColor("#0066FE") |
| 72 | self.tabBar.isTranslucent = false | 70 | self.tabBar.isTranslucent = false |
| 73 | 71 | ||
| 74 | - self.viewControllers = [ | ||
| 75 | - CNLiveBaseNavigationController(rootViewController: homeVC),CNLiveBaseNavigationController(rootViewController: authVC), | ||
| 76 | - CNLiveBaseNavigationController(rootViewController: mineVC)] | 72 | + self.viewControllers = [CNLiveBaseNavigationController(rootViewController: homeVC),CNLiveBaseNavigationController(rootViewController: authVC),CNLiveBaseNavigationController(rootViewController: mineVC)] |
| 73 | + | ||
| 74 | + self.selectedIndex = 0 | ||
| 77 | } | 75 | } |
| 78 | 76 | ||
| 79 | // MARK: - Tabar 背景图 | 77 | // MARK: - Tabar 背景图 |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
| @@ -79,6 +79,16 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | @@ -79,6 +79,16 @@ class CNDownSlideSingleCourseCell: UITableViewCell { | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | func setupNewUI(model:CNLiveDownSlideModel){ | 81 | func setupNewUI(model:CNLiveDownSlideModel){ |
| 82 | + contentView.subviews.forEach { view in | ||
| 83 | + view.removeFromSuperview() | ||
| 84 | + } | ||
| 85 | + bgBackView.subviews.forEach { view in | ||
| 86 | + view.removeFromSuperview() | ||
| 87 | + } | ||
| 88 | + bgImageView.subviews.forEach { view in | ||
| 89 | + view.removeFromSuperview() | ||
| 90 | + } | ||
| 91 | + | ||
| 82 | if model.type == SlideModelTypeAllCourse12 { | 92 | if model.type == SlideModelTypeAllCourse12 { |
| 83 | //全部课程列表 | 93 | //全部课程列表 |
| 84 | contentView.addSubview(bgBackView) | 94 | contentView.addSubview(bgBackView) |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift
| @@ -135,8 +135,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -135,8 +135,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 135 | if slideModel.type == SlideModelTypeRecommend4{ | 135 | if slideModel.type == SlideModelTypeRecommend4{ |
| 136 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRecommendCellIdentifier) as? CNLiveDownSlideRecommendCell | 136 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideRecommendCellIdentifier) as? CNLiveDownSlideRecommendCell |
| 137 | else { | 137 | else { |
| 138 | - // let cell = CNLiveDownSlideRecommendCell() | ||
| 139 | - // cell.slideModel = slideModel | ||
| 140 | return CNLiveDownSlideRecommendCell() | 138 | return CNLiveDownSlideRecommendCell() |
| 141 | } | 139 | } |
| 142 | cell.slideModel = slideModel | 140 | cell.slideModel = slideModel |
| @@ -145,7 +143,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -145,7 +143,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 145 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) as? CNLiveDownSlideTodayRecommendCell | 143 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) as? CNLiveDownSlideTodayRecommendCell |
| 146 | else { | 144 | else { |
| 147 | let cell = CNLiveDownSlideTodayRecommendCell() | 145 | let cell = CNLiveDownSlideTodayRecommendCell() |
| 148 | - cell.slideModel = slideModel | ||
| 149 | return cell | 146 | return cell |
| 150 | } | 147 | } |
| 151 | cell.slideModel = slideModel | 148 | cell.slideModel = slideModel |
| @@ -154,7 +151,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -154,7 +151,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 154 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell | 151 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 155 | else { | 152 | else { |
| 156 | let cell = CNDownSlideSingleCourseCell() | 153 | let cell = CNDownSlideSingleCourseCell() |
| 157 | - cell.slideModel = slideModel | ||
| 158 | return cell | 154 | return cell |
| 159 | } | 155 | } |
| 160 | cell.slideModel = slideModel | 156 | cell.slideModel = slideModel |
| @@ -163,7 +159,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -163,7 +159,6 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 163 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell | 159 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 164 | else { | 160 | else { |
| 165 | let cell = CNDownSlideSingleCourseCell() | 161 | let cell = CNDownSlideSingleCourseCell() |
| 166 | - cell.slideModel = slideModel | ||
| 167 | return cell | 162 | return cell |
| 168 | } | 163 | } |
| 169 | cell.slideModel = slideModel | 164 | cell.slideModel = slideModel |
metaCode/Classes/Main/HomePages/View/HomePage/CNLiveHomePageDuanJuCell.swift
| @@ -12,7 +12,6 @@ typealias DuanJUCellSelectedCallBackBlock = (_ cell: CNLiveHomePageDuanJuCell) - | @@ -12,7 +12,6 @@ typealias DuanJUCellSelectedCallBackBlock = (_ cell: CNLiveHomePageDuanJuCell) - | ||
| 12 | 12 | ||
| 13 | class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDataSource{ | 13 | class CNLiveHomePageDuanJuCell:UITableViewCell,UITableViewDelegate,UITableViewDataSource{ |
| 14 | let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" | 14 | let kCNLiveAlbumCellIdentifier = "kCNLiveAlbumCellIdentifier" |
| 15 | -// let bgBackView = UIView() | ||
| 16 | 15 | ||
| 17 | var DuanJUCellSelectedCallBack:DuanJUCellSelectedCallBackBlock? | 16 | var DuanJUCellSelectedCallBack:DuanJUCellSelectedCallBackBlock? |
| 18 | lazy var modelArr: NSMutableArray = { | 17 | lazy var modelArr: NSMutableArray = { |
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_authentication.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_authentication_unSelect.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_default.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_hoem_icon_selected.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_default.imageset/Contents.json
metaCode/Supporting Files/Assets.xcassets/TabBar/tabbar_mine_icon_selected.imageset/Contents.json