DZNEmptyDataSet icon indicating copy to clipboard operation
DZNEmptyDataSet copied to clipboard

Empty string not visible after table scrolled up and cleared

Open ashish-naik opened this issue 6 years ago • 1 comments

For a UITableView inside a UIViewController, i observed an issue as below. my view shows UISearchController with scope bar.

I am returning string from description delegate method to show empty state

  1. Search using UISearchController and load table with data
  2. Clear the search bar text - empty string appears in middle
  3. Search using UISearchController again and load table with data
  4. Scroll up table 2-3 rows
  5. Clear the search bar text - empty string appears near bottom

Another similar scenario

  1. Search using UISearchController and load table with data
  2. Clear the search bar text - empty string appears in middle
  3. Search using UISearchController again and load table with data
  4. Scroll up table many rows
  5. Clear the search bar text - empty string doesn't appear

I have captured screenshot of visual debugger that shows emptyDataSetlView starting near bottom which seems to be the reason empty string is not visible. see screenshot.

I tried below from some suggestions from some issues here. In fact, offset() method isnt even called.

func verticalOffset(forEmptyDataSet scrollView: UIScrollView!) -> CGFloat {

      return self.feedTableView.frame.size.height/2.0

  }
  
  func offset(forEmptyDataSet scrollView: UIScrollView!) -> CGPoint {

      let top = scrollView.contentInset.top / 2
      let bottom = scrollView.contentInset.bottom / 2
      return CGPoint(x: 0, y: top-bottom)

      
  }
empty set issue

ashish-naik avatar Jun 23 '18 14:06 ashish-naik

@dzenbot Could you please look at this issue?

Thanks Ashish

ashish-naik avatar Jun 24 '18 08:06 ashish-naik