Ionic nav-bar: Title is not centered on Android Device

后端 未结 9 1053
别跟我提以往
别跟我提以往 2021-02-01 17:20

Im very new to Ionic but i already like it. I wanted to use the nav-barso i implemented the following index.html:




        
9条回答
  •  暖寄归人
    2021-02-01 17:59

    I wrote a fix for Ionic 2.0.x

    Add the following style to your .scss file (I placed it in app.scss)

    //  Centering title
    // --------------------------------------------------
    // a fix for centering the title on all the platforms
    
    ion-header {
      .button-md {
        box-shadow: none;
      }
    
      .toolbar-title {
        display: -webkit-flex;
        display: flex;
        -webkit-flex-direction: row;
        flex-direction: row;
        -webkit-align-items: center;
        align-items: center;
        -webkit-justify-content: center;
        justify-content: center;
      }
    }
    

    After that add the following markup to your page

    
      
      
        
          
        
    
        
          Your title or image
        
    
        
          
        
      
    
    

提交回复
热议问题