DZNEmptyDataSet icon indicating copy to clipboard operation
DZNEmptyDataSet copied to clipboard

Consider UIScrollView contentInset

Open sdduursma opened this issue 8 years ago • 4 comments

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?

sdduursma avatar Apr 29 '16 09:04 sdduursma

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?

dzenbot avatar May 13 '16 12:05 dzenbot

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.

ferranpujolcamins avatar May 23 '18 15:05 ferranpujolcamins

Any updates on this one?

artemstepanenko avatar Jun 01 '18 10:06 artemstepanenko

it's too bad to use with UICollectionView.

internalG avatar Jul 30 '18 08:07 internalG