DZNEmptyDataSet
DZNEmptyDataSet copied to clipboard
Consider UIScrollView contentInset
I have a search bar with a table view below. When the keyboard is shown, I adjust UITableVIew
's contentInset
so no content is hidden by the keyboard. If the search provides no results an empty data set is shown using DZNEmptyDataSet. The problem is that the empty data set doesn't consider the content inset, and thus is partially hidden below the keyboard.
I was able to fix this by not using contentInset
but instead changing the constraint between the table view and the bottom of the root view so the whole table view is always above the keyboard. However this requires a lot of code and is quite a clumsy solution in my opinion.
Would it make sense for DZNEmptyDataSet to adjust the position of it's content based on UIScrollView
's contentInset
?
I think the library should consider the contentInset
. The only reason why this hasn't been added before is because contentInset
isn't "animatable". When it comes to the keyboard showing up, most of the time I adjust the tableView's height instead, so its subviews animate with the same curve.
Either way, we could used of this feature. Want to give it a try?
Right now DZNEmptyDataSet
is not compatible with Material FlexibleHeader. MDCFlexibleHeader
is a view that overlays a UIScrollView
, but adjusts the scrollview's contentInset
so the header does not hide the content of the scrollview.
Since DZNEmptyDataSet
does not take into account the contentInset
, its view is drawn under the header view and is not visible.
Any updates on this one?
it's too bad to use with UICollectionView.