UITableView contentOffSet is not working properly

前端 未结 15 1789
滥情空心
滥情空心 2020-12-14 01:48

In viewWillAppear, I have added UISearchBar as my headerview of UITableView. When view loads, I hides UISearchbar under <

15条回答
  •  旧巷少年郎
    2020-12-14 02:32

    It may be because of the "Adjust Scroll View Insets" attribute on the View Controller. See this: https://stackoverflow.com/a/22022366

    EDIT: Be sure to check the value of 'contentInset' to see what's happening, since this also has an effect on the scroll view. This value is changed after viewWillAppear: when "Adjust Scroll View Insets" is set, which seems to be what others are trying to avoid by using dispatch queues and the like.

提交回复
热议问题