2016年4月4日 星期一

[iOS] UITableView scroll to top when typing in the textfield will scroll to a wrong location

My case is this:

I have a static table, with hidden cell(height = 0), custom cell that will open keyboard, and a reset button(that will reload table and scroll to top)

What is the problem:

Scroll to top will go to invalid offset.

How to regenerate:

type in the keyboard, reset(which scroll to top and reload the keyboard) and there will be space between my top cell and top of table (just like hidden cell consumed some space)

---

At first I thought it is the hidden cell problem, but it turns out to be problem on [tableView reloadData]

**[tableView reloadData] will interrupt scrolling, so make sure you call [tableView setContentOffset:] or [tableView scrollToRowAtIndexPath:] after all reload is done.

Reference: stackoverflow

7 則留言:

  1. Nice Post !
    To fix such issue, you must contact our experts via QuickBooks Customer Support Number 1-855-974-6537 and get permanent ways to solve QuickBooks problems. Our team consists of highly qualified professionals who provide the best ways to troubleshoot QuickBooks problems.

    回覆刪除
  2. Hey! Good blog. I was facing an error in my QuickBooks software, so I called QuickBooks Error 1328 (855)-756-1077. I was tended to by an experienced and friendly technician who helped me to get rid of that annoying issue in the least possible time.

    回覆刪除
  3. Nice & Informative Blog !
    QuickBooks Error 248 is an error that usually occurs when you are working on QuickBooks software. If you are also struggling with the same error, we have solutions for you.

    回覆刪除
  4. Hey! Excellent work. Being a QuickBooks user, if you are struggling with any issue, then dial QuickBooks Customer Service Our team at QuickBooks will provide you with the best technical solutions for QuickBooks problems.

    回覆刪除
  5. Hey! Fabulous post. It is the best thing that I have read on the internet today. Moreover, if you need instant support for QuickBooks Error, visit at QuickBooks Customer Service Number Our team is always ready to help and support their clients.

    回覆刪除
  6. Very good and quick service. I would like to thank the QuickBooks Customer Service Number (855)428-7237 team for their effective assistance. Our team at QuickBooks will provide you with the best technical solutions for QuickBooks problems.

    回覆刪除
  7. 作者已經移除這則留言。

    回覆刪除