I use Ionic 3, below the code cannot align the title to center, it moves a little bit right due to the ion-buttons. How can it be solved?
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-button (click)="close()">
<ion-icon name="arrow-back"></ion-icon>
</ion-button>
</ion-buttons>
<ion-title text-center>{{bookName}}</ion-title>
</ion-toolbar>
</ion-header>
just add mode=ios at title like this
<ion-title mode=ios>Your Title</ion-title>
Tested in ionic 3, 4 and 5 both
You could try to wrap your title in a div like this:
<div text-center>
<ion-title>YOUR TITLE</ion-title>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With