ios - Search Bar is changing position when clicked -
i have written code searchbar in objective c ios devices , working fine on iphone when comes ipad changing x value , due cancel button hiding.
initially search bar looks like:
after clicking in search bar:
does face issue , suggest me in ?
here code:
self.searchcontroller = [[uisearchcontroller alloc] initwithsearchresultscontroller:nil]; self.searchcontroller.searchbar.delegate = self; self.searchcontroller.searchresultsupdater = self; self.searchcontroller.dimsbackgroundduringpresentation = no; followtableview.tableheaderview = self.searchcontroller.searchbar; uisearchbar.appearance.tintcolor = [uicolor whitecolor]; //cancel button color [self.searchcontroller.searchbar sizetofit]; tapgesture = [[uitapgesturerecognizer alloc]init]; [tapgesture addtarget:self action:@selector(tapgesturebtnaction:)]; self.searchcontroller.searchbar.bartintcolor = searchbarcolor; -(ibaction)tapgesturebtnaction:(id)sender { [_searchcontroller.searchbar resignfirstresponder]; [self.view removegesturerecognizer:tapgesture]; }
thanks in advance.
thank guys participation.
by setting, self.definespresentationcontext = no; issue resolved. found solution following this: uisearchcontroller search bar position drops 64 points
Comments
Post a Comment