如何修改buttonBarView selectedBar的宽度,我不要他那么宽
问问题
316 次
1 回答
0
这就是我能够实现标签大小调整的方式。由于 ButtonBarPagerTabStripViewController 从 UICollectionView 继承,您可以重写 sizeForItemAtIndexPath 函数并返回首选宽度和高度。
斯威夫特 3
override func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: IndexPath) -> CGSize {
return CGSize(width: "preferred witdth", height: collectionView.frame.size.height)
}
于 2017-06-28T18:13:38.967 回答