如何修改buttonBarView selectedBar的宽度,我不希望他那么宽

时间:2017-03-30 08:31:58

标签: xlpagertabstrip

enter image description here

如何修改buttonBarView selectedBar宽度,我不希望他如此宽广

1 个答案:

答案 0 :(得分:0)

这就是我能够实现选项卡大小调整的方法。由于ButtonBarPagerTabStripViewController继承自UICollectionView,您只需覆盖sizeForItemAtIndexPath函数并返回首选宽度和高度。

Swift 3

override func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
    return CGSize(width: "preferred witdth", height: collectionView.frame.size.height)
}
相关问题