# Hiding/Showing ion-view header based on button press

**URL:** <https://forum.ionicframework.com/t/hiding-showing-ion-view-header-based-on-button-press/25912>\
**Category:** ionic-v1\
**Created:** [June 6, 2015, 7:08pm UTC](https://forum.ionicframework.com/t/hiding-showing-ion-view-header-based-on-button-press/25912 "2015-06-06T19:08:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arjunrc](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arjunrc/32/82541_2.png) [@arjunrc](https://forum.ionicframework.com/u/arjunrc)\
**Post date:** [June 6, 2015, 7:08pm UTC](https://forum.ionicframework.com/t/hiding-showing-ion-view-header-based-on-button-press/25912/1 "2015-06-06T19:08:54Z")

</div>

Hi, I have an ion-view where I need to hide the ion-view header _dynamicaly_ and enable it back if the user presses a button

I’ve tried the following

```auto
<ion-view title="Montage View" class="bar-stable" cache-view="false" hide-nav-bar="{{minimal}}">

```

Where minimal gets toggled when the user presses a button like so:

```auto
  <button class="button button-icon button-clear ion-android-contract" ng-click="switchMinimal()"></button>

```

and in the controller:

```auto
$scope.minimal=false;
$scope.switchMinimal = function()
    {
        $scope.minimal = !$scope.minimal;
        console.log ("Hide Statusbar");
        ionic.Platform.fullScreen(true,false);
        
    };

```

This does not hide the nav-bar as when it is first loaded, minimal is false. I tried adding

```auto
$state.go($state.current, {}, {reload: true});

```

inside switchMinial() but that also resets the minimal flag. I also tried $state.refresh() - they both seem to re-initialize the controller

Any ideas?

---

<div class="post-metadata">

**Author:** ![arjunrc](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/arjunrc/32/82541_2.png) [@arjunrc](https://forum.ionicframework.com/u/arjunrc)\
**Post date:** [June 6, 2015, 8:37pm UTC](https://forum.ionicframework.com/t/hiding-showing-ion-view-header-based-on-button-press/25912/2 "2015-06-06T20:37:02Z")

</div>

Okay, I solved the problem by using state parameters that I pass to the state in .go

```auto
.state('montage', {
        url: "/montage",
        templateUrl: "templates/montage.html",
        controller: 'zmApp.MontageCtrl',
        params: {minimal:false}

    });

```

The view header code:

```auto
<ion-view title="Montage View" class="bar-stable" cache-view="false" hide-nav-bar="{{minimal}}">

```

And then the toggle between full screen and normal in that view:

```auto
$scope.switchMinimal = function()
    {
        $scope.minimal = !$scope.minimal;
        console.log ("Hide Statusbar");
        ionic.Platform.fullScreen($scope.minimal,!$scope.minimal);
      
        $ionicHistory.nextViewOptions({
              disableAnimate: true,
              disableBack: true
            });
      $state.go("montage", {minimal: $scope.minimal});  
    };

```
