【发布时间】:2019-05-26 07:15:51
【问题描述】:
我想用集合视图替换表格视图,表格视图位于 XLPagerTabStrip 的选项卡内。
我已经尝试替换一些东西,但我得到了一些错误,有人可以让我朝着正确的方向前进吗?
import UIKit
import XLPagerTabStrip
class BooksChildViewController: UITableViewController,
IndicatorInfoProvider {
let cellIdentifier = "postCell"
var blackTheme = false
var itemInfo = IndicatorInfo(title: "Livros")
init(style: UITableViewStyle, itemInfo: IndicatorInfo) {
self.itemInfo = itemInfo
super.init(style: style)
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
// MARK: - IndicatorInfoProvider
func indicatorInfo(for pagerTabStripController:
PagerTabStripViewController) -> IndicatorInfo {
return itemInfo
}
}
【问题讨论】:
-
如果你需要一个Collectionview,你为什么要创建一个UITableViewController?你需要在你的 UI 中同时使用这两者吗?您应该从简单的 UIViewController 继承您的 Viewcontroller,并使其适应 TableView 和 CollectionView 委托/数据源。
标签: ios swift uicollectionview tableview xlpagertabstrip