Skip to content

Conversation

@DarielChen
Copy link

Like tableview. When stackView content size is less than view height, it can also scroll.

Comment on lines +38 to +39
edgesForExtendedLayout = []
navigationController?.navigationBar.isTranslucent = false
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make view's top equals navigationBar's bottom

setUpHiddenRows()
setUpExpandingRowView()
setUpHorizontalRow()
// when hide PhotoRow stackview can also scroll
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment

Comment on lines +43 to +56

open override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
if stackViewCanAlwaysScroll {
if stackView.contentSize.height < view.frame.size.height {
var bottomPadding: CGFloat = 0
if #available(iOS 11.0, *) {
bottomPadding = UIApplication.shared.keyWindow?.safeAreaInsets.bottom ?? 0
}
// contentSize height need to bigger than view height
stackView.contentSize = CGSize(width: 0, height: view.frame.size.height - bottomPadding + 0.5)
}
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark stackView always scroll

Comment on lines +67 to +71

/// When true, stackView can always scroll
///
/// Default is `true`.
open var stackViewCanAlwaysScroll = true
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool value for stackViewCanAlwaysScroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant