|
@@ -111,9 +111,11 @@ class BFVoiceSettingView: UIView {
|
|
|
layout.scrollDirection = .vertical
|
|
|
// layout.itemSize = CGSize(width: adapterWidth(width: 60), height: 78)
|
|
|
// 每行最小边距
|
|
|
- layout.minimumLineSpacing = 20
|
|
|
+
|
|
|
+ layout.minimumLineSpacing = adapterWidth(width: 20)
|
|
|
// 每列最小边距
|
|
|
- layout.minimumInteritemSpacing = 24
|
|
|
+ layout.minimumInteritemSpacing = 24
|
|
|
+// layout.minimumInteritemSpacing = (cScreenWidth - 64 - 240) / 3
|
|
|
layout.sectionInset = UIEdgeInsets.zero
|
|
|
|
|
|
let collectView = UICollectionView(frame: CGRect(x: 32, y: 118, width: cScreenWidth - 32 * 2, height: 242), collectionViewLayout: layout)
|
|
@@ -270,13 +272,14 @@ class BFVoiceSettingView: UIView {
|
|
|
}
|
|
|
|
|
|
extension BFVoiceSettingView: UICollectionViewDelegate, UICollectionViewDataSource, UIScrollViewDelegate, UICollectionViewDelegateFlowLayout {
|
|
|
+
|
|
|
func collectionView(_ collectionView: UICollectionView,
|
|
|
layout _: UICollectionViewLayout,
|
|
|
sizeForItemAt indexPath: IndexPath) -> CGSize {
|
|
|
if collectionView == catagaryCollectView {
|
|
|
return CGSize(width: adapterWidth(width: 52) + 9, height: 40)
|
|
|
}
|
|
|
- return CGSize(width: adapterWidth(width: 60), height: 78)
|
|
|
+ return CGSize(width:(cScreenWidth - 64 - 3 * 24) / 4, height: 78)
|
|
|
}
|
|
|
|
|
|
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection _: Int) -> Int {
|