ios - Navigation bar is hiding on swipe and scroll -


i customising navigation bar way in swift

navigationitem.title = "support"             let menubutton = uibarbuttonitem(image: uiimage(named: "menuicon"), style: uibarbuttonitemstyle.plain, target: self, action: "showmenu:") navigationitem.rightbarbuttonitem = menubutton self.navigationitem.sethidesbackbutton(true, animated:false) 

i customising navigation item in view controller , table view controller. problem navigation hiding when swipe in view controller or scroll in table view controller. how fix navigation bar being hidden on swipe , scroll means should not hidden everytime.

the following code should work you:

class viewcontroller: uiviewcontroller {      @ibaction func toggle(sender: anyobject) {         navigationcontroller?.setnavigationbarhidden(navigationcontroller?.navigationbarhidden == false, animated: true) //or animated: false     }      override func prefersstatusbarhidden() -> bool {         return navigationcontroller?.navigationbarhidden == true     }      override func preferredstatusbarupdateanimation() -> uistatusbaranimation {         return uistatusbaranimation.fade     }      override func viewdidload() {         super.viewdidload()     }      override func didreceivememorywarning() {         super.didreceivememorywarning()     }  } 

link ibaction uibutton in viewcontroller's storyboard scene make work. alternative, can replace ibaction uigesturerecognizer.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -