0

I have searchDisplayController,which is table headerView of my tableView.My tableview scrolling works smooth and perfect and tableview consist of 3 rows.My issue is my tableView scrolls to top,then bounce back at that time my tableViewHeader(UIsearchbar) cannot seen it goes to behind the navigation bar.Then scroll to down i can see my tableViewHeader(UISearch bar). When first time view loading the contentOffset on my console is {0,0},then scroll to top and bounce back at that time my contentOffset last value on my console is {0,44}.How to solve this issue?Please help me..

IKKA
  • 6,297
  • 7
  • 50
  • 88
  • Can you post the code you are using for scroll to top.? Generally setting the scroll to top works with calculating the size of status bar and navigation bar so I say you need take the size of those elements in to account. Post your code please. – Adrian P Mar 13 '14 at 14:12
  • @XCodeMonkey,nothing to do new for scroll to top,my tableView scrolling up and down automatically.. – IKKA Mar 13 '14 at 14:49
  • one more thing, you can set the content offset of the tableview manually. that way it will override it. something like this [self.tableView setContentOffset:CGPointMake(0, 0) animated:YES]; and set to where you want it to be. – Adrian P Mar 13 '14 at 15:22

1 Answers1

1

In ios7,don’t set directly add 'tableHeaderView' as 'UISearchBar'.Firstly i added my 'UISearchBar' to plain 'UIView',then set my 'tableHeaderView' as plain 'UIView'.

by programatically do following code..

[self.plainView addSubview:mySearchBar];

self.mTableView.tableHeaderView = self.plainView   
IKKA
  • 6,297
  • 7
  • 50
  • 88