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

后端 未结 9 1219
别跟我提以往
别跟我提以往 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:43

    By design Android titles are aligned to the left. I believe the correct way to change this behaviour is by using the $ionicConfigProvider in your angular .config method for your main angular module. This provider has a property navBar.alignTitle(value) where "value" can be platform(default), left, right or center. This is described in the docs here

    For example

    var myApp = angular.module('reallyCoolApp', ['ionic']);
    
    myApp.config(function($ionicConfigProvider) {
    
      // note that you can also chain configs
      $ionicConfigProvider.navBar.alignTitle('center');
    });
    

    This In my opinion is the correct way to override this behaviour.

提交回复
热议问题