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
Post a Comment