2017-01-21 73 views

回答

4

崩潰背後的原因是,ButtonCell.xib中缺少UIImageView。

解決辦法是:

  1. 打開ButtonBarViewCell類,在Xcode的頂部導航菜單,點擊ButtonBarViewCell.There可以看到ButtonCell.xib。
  2. 打開ButtonCell.xib,將UIImage視圖拖放到單元格的中心。應用約束並將其連接到IBOutlet imageView。
  3. 返回到ButtonBarViewCell類,並在 內添加以下代碼行func willMove(toSuperview newSuperview:UIView?)函數。

如果imageView.superview!= {零 contentView.addSubview(ImageView的) }

4.Go回實施的頁面,並添加該代碼

func indicatorInfo(for pagerTabStripController: PagerTabStripViewController) -> IndicatorInfo { 
    return IndicatorInfo(title: "",image: UIImage(named: "camera.png")) 
} 

5.done

`

相關問題