离子模态 - 保持导航栏/菜单可见

时间:2016-02-07 21:38:34

标签: javascript jquery angularjs ionic-framework

我想将我的页面放到模式上滑动,保持菜单栏静态(例如,当模式打开时,菜单/顶栏不会向上滑动)。< / p>

模态幻灯片向上 - 但导航栏/菜单栏应该是白色的。创建空间(使用class =“has-header”)但它是白色的。

enter image description here

通过单击放大玻璃,可在此站点上激活模态 - click here。我没有尝试制作一个plunker(here)。

这是我的代码:

打开模态(在我的.html中)

<i class="ion-ios-search-strong" ng-click="refineevent()"></i>

我的部分内容

$ionicModal.fromTemplateUrl('app/components/stores/stores.html', {
    scope: $scope,
    animation: 'slide-in-up'
}).then(function(modal){$scope.modal = modal;});

$scope.refineevent = function(){$scope.modal.show();};

$scope.closeModal = function(){$scope.modal.hide();};


$scope.$on('modal.shown', function(){console.log('Modal is shown!');});

    }

我的modal.html文件:

<ion-modal-view>
<ion-view name="stores"><ion-pane ng-controller="storesCtrl">

            <ion-content class="has-header">
  ...
        </ion-content>

</ion-view>
</ion-modal-view>

1 个答案:

答案 0 :(得分:1)

对于模态,您必须创建标题。所以......

<ion-modal-view>
<ion-header-bar>
    <button class="button button-clear icon ion-drag"></button>
    <h1 class="title">LOGO</h1>
    <button class="button button-clear icon ion-hanger"></button>
</ion-header-bar>
    <ion-content>
    </ion-content>
</ion-modal-view>