2016-06-14 43 views
0

我很努力将subheader添加到基于标签的Ionic应用程序中。问题在于,Android中未显示subheader,但在iOS中显示。Ionic:Subheader不会显示在基于标签的Android应用程序中

enter image description here

我想用的子报头的一个搜索栏,这样它不滚动走与内容娄它。

步骤来重现问题:

  1. 创建基于选项卡项目的测试应用程式:

ionic start subheader-test tabs

  • 修改.\subheader-test\www\templates\tab-dash.html到在“状态”选项卡上添加子标题,使其看起来像文件波纹管:
  • <ion-view view-title="Dashboard"> 
     
    
     
        <ion-header-bar class="bar-subheader bar-balanced"> 
     
        <h1 class="title">Subheader</h1> 
     
        </ion-header-bar> 
     
    
     
        <ion-content class="padding"> 
     
        <h2>Welcome to Ionic</h2> 
     
        <p> 
     
         .... 
     
        </p> 
     
        </ion-content> 
     
    </ion-view>

  • 开始离子的实验室:
  • ionic serve -l

    我的has-subheaderhas-header归类组合测试ion-content,但它是徒劳无功。

    在我测试的任何浏览器(Chrome,Firefox,IE 11)中,子标题未显示在应用程序的Android版本中。

    回答

    1

    这可能会解决问题:

    WWW/CSS/的style.css

    .platform-android .bar-subheader.has-tabs-top{ 
        top:93px !important; 
    } 
    
    .platform-android .has-subheader.has-tabs-top{ 
        top:137px; 
    } 
    

    或者,也许你可以在添加$ionicConfigProvider.tabs.position('bottom'); app.js这样的:

    .config(function($stateProvider, $urlRouterProvider, $ionicConfigProvider) { 
    
        $ionicConfigProvider.tabs.position('bottom'); 
        // 
        } 
    
    +0

    我使用了带CSS样式的选项 - 有用。非常感谢你,我没有想到我很快得到了正确的答案。 –

    0

    它不适合我。我不得不从子标题CSS中删除"has-tabs-top"类以使其运行(在Chrome控制台中查看时,该类未在运行ionic服务时分配给子标题--lab)

    相关问题