objective c - iOS UITableView content offset not working in iOS7 -


in app have search bar in header of myuitableview. tried set content offset uitableview hiding search bar giving me problems.

finally solved this:

- (void)viewwillappear:(bool)animated {     [self performselector:@selector(hidesearchbar) withobject:nil afterdelay:0.0f]; }  - (void)hidesearchbar  {     self.tblview.contentoffset = cgpointmake(0, 40); } 

the problem works ios 8.

how can achieve correctly work both ios 7 & 8 ????

sorry poor english. in advance.

if set header self.tblview.tableheaderview = yoursearchbar (recommended way),try

self.tblview.tableheaderview = nil; 

or

self.tblview.tableheaderview = [[uiview alloc] initwithframe:cgrectzero]; 

to hide it.

ps. yoursearchbar should instance variable or property displayed conveniently in future.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -