2016-06-14 46 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)

    相關問題