ios - Tap Gesture to Hide Navigation Bar, Tab Bar, and Status Bar -


i trying implement tap gesture on web view hide/show navigation bar, tab bar, , status bar. have hiding/showing of navigation bar working fine , can hide status bar not show up. tab bar items hidden bar still there. can this?

- (void)togglebars:(uitapgesturerecognizer *)gesture {        [[uiapplication sharedapplication] setstatusbarhidden:yes withanimation:uistatusbaranimationslide];     bool statusbarhidden = yes;      bool barshidden = self.navigationcontroller.navigationbar.hidden;     [self.navigationcontroller setnavigationbarhidden:!barshidden animated:yes];      bool tabbarhidden = self.tabbarcontroller.tabbar.hidden;     [self.tabbarcontroller.tabbar sethidden:!tabbarhidden]; }  - (void)viewdidload {     [super viewdidload];     // additional setup after loading view nib.      uibarbuttonitem *systemaction = [[uibarbuttonitem alloc] initwithbarbuttonsystemitem:uibarbuttonsystemitemaction target:self action:@selector(showmenu)];     self.navigationitem.rightbarbuttonitem = systemaction;      uitapgesturerecognizer *singletap = [[uitapgesturerecognizer alloc]initwithtarget:self action:@selector(togglebars:)];     [webview addgesturerecognizer:singletap];     singletap.delegate = self; }  - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldrecognizesimultaneouslywithgesturerecognizer:(uigesturerecognizer *)othergesturerecognizer {     return yes; } 

edit: looks tab bar hiding webview isn't filling empty space. how can have fill space when tab bar hidden?

first of all, status bar never unhides because never tell to. written code merely tells status bar hide every time executed.

[[uiapplication sharedapplication] setstatusbarhidden:![[uiapplication sharedapplication] isstatusbarhidden] withanimation:uistatusbaranimationslide];  [self.navigationcontroller setnavigationbarhidden:!self.navigationcontroller.navigationbar.hidden animated:yes]; 

additionally, i'm not sure details of why tab bar isn't hiding properly, did find following category claims able hide tab bar option animation.

https://github.com/idevsoftware/cocoa-touch-additions/tree/master/uitabbarcontroller_sethidden


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -