From dddaf0fa8bb2e9b77f1d5db6c11980c9e1d60acf Mon Sep 17 00:00:00 2001 From: Robert <Robert@qq.com> Date: 星期一, 18 八月 2025 18:22:11 +0800 Subject: [PATCH] fix bug --- WanPai/Common/View/WorldCupListRankView.swift | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/WanPai/Common/View/WorldCupListRankView.swift b/WanPai/Common/View/WorldCupListRankView.swift index 7a2ceec..84d0666 100644 --- a/WanPai/Common/View/WorldCupListRankView.swift +++ b/WanPai/Common/View/WorldCupListRankView.swift @@ -11,14 +11,16 @@ class WorldCupListRankView: UIView,JQNibView, UITableViewDelegate, UITableViewDataSource { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return dataSoure?.count ?? 0 + } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tabview.dequeueReusableCell(withIdentifier: "WorldCupListRankViewCellId", for: indexPath) as! WorldCupListRankViewCell - cell.chooseBtn.isSelected = indexPath.row == selectIndex + cell.chooseBtn.isSelected = indexPath.row == selectIndex ? true : false cell.index = indexPath.row + cell.selectionStyle = .none cell.tag = indexPath.row - + cell.titleLab.text = dataSoure?[indexPath.row].name ?? "" // RxSwift绑定 cell.chooseBtn.rx.tap .map { cell.tag } // 从cell的tag获取行索引 @@ -42,7 +44,7 @@ var dataSoure: Array<GetWorldCupListFromRank>? - var disposeBag:DisposeBag! + var disposeBag = DisposeBag() var selectIndex = 0 @@ -53,7 +55,9 @@ tabview.delegate = self tabview.dataSource = self tabview.separatorStyle = .none - tabview.register(WorldCupListRankViewCell.self, forCellReuseIdentifier: "WorldCupListRankViewCellId") + tabview.rowHeight = 44 +// tabview.register(WorldCupListRankViewCell.self, forCellReuseIdentifier: "WorldCupListRankViewCellId") + tabview.register(UINib(nibName: "WorldCupListRankViewCell", bundle: nil), forCellReuseIdentifier: "WorldCupListRankViewCellId") sureAction.layer.masksToBounds = true sureAction.layer.cornerRadius = 5 -- Gitblit v1.7.1