Skip to content

Commit 2be1e1b

Browse files
committed
Add contentInset
1 parent da527d6 commit 2be1e1b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

StackScrollView/StackScrollView.swift

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,26 @@ open class StackScrollView: UIView, UICollectionViewDataSource, UICollectionView
4242

4343
private let collectionView: InternalCollectionView
4444

45+
open var contentInset: UIEdgeInsets {
46+
get {
47+
return collectionView.contentInset
48+
}
49+
set {
50+
collectionView.contentInset = newValue
51+
}
52+
}
53+
54+
open var scrollIndicatorInsets: UIEdgeInsets {
55+
get {
56+
return collectionView.scrollIndicatorInsets
57+
}
58+
set {
59+
collectionView.scrollIndicatorInsets = newValue
60+
}
61+
}
62+
63+
// MARK: - Initializers
64+
4565
public init(frame: CGRect, collectionViewLayout: UICollectionViewFlowLayout) {
4666
collectionView = InternalCollectionView(frame: frame, collectionViewLayout: collectionViewLayout)
4767
super.init(frame: frame)
@@ -68,14 +88,16 @@ open class StackScrollView: UIView, UICollectionViewDataSource, UICollectionView
6888

6989
private func setup() {
7090

91+
backgroundColor = .white
92+
7193
addSubview(collectionView)
7294
collectionView.frame = bounds
7395
collectionView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
7496

7597
collectionView.alwaysBounceVertical = true
7698
collectionView.delaysContentTouches = false
7799
collectionView.keyboardDismissMode = .interactive
78-
collectionView.backgroundColor = .white
100+
collectionView.backgroundColor = .clear
79101

80102
collectionView.delegate = self
81103
collectionView.dataSource = self

0 commit comments

Comments
 (0)