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:

enter image description here

after clicking in search bar:

enter image description here

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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -