-
Notifications
You must be signed in to change notification settings - Fork 170
make stackview always scroll #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| edgesForExtendedLayout = [] | ||
| navigationController?.navigationBar.isTranslucent = false |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment
|
|
||
| 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) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mark stackView always scroll
|
|
||
| /// When true, stackView can always scroll | ||
| /// | ||
| /// Default is `true`. | ||
| open var stackViewCanAlwaysScroll = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool value for stackViewCanAlwaysScroll
Like tableview. When stackView content size is less than view height, it can also scroll.