我正在使用View pager应用程序制作一个应用程序,正在使用XLPagerTabStrip库来制作它。与Viewpager项中的“标题”一起使用时效果很好。我想在其中添加图标和相应的标签。
最佳答案
崩溃背后的原因是,ButtonCell.xib中缺少UIImageView。
解决方法是:
func willMove(toSuperview newSuperview:UIView?)函数。
如果imageView.superview!= nil {
contentView.addSubview(imageView)
}
4.返回实现页面的类并添加此代码
func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo {
return IndicatorInfo(title: "",image: UIImage(named: "camera.png"))
}
5.完成
`