ionic – How to wordwrap a long string in ion-header

Issue

This is my code, and I tried text-wrap , inside ion-header still can not show whole title.

<ion-header>
  <ion-toolbar text-wrap color="danger">
    <ion-buttons>
        <button ion-button navPop icon-only>
            <ion-icon ios="ios-arrow-back" md="md-arrow-back"></ion-icon>
        </button>
    </ion-buttons>
    <ion-title>{{new.title}}</ion-title>
  </ion-toolbar>
</ion-header>

enter image description here

Update

<ion-header>
  <ion-toolbar color="danger">
    <ion-buttons>
        <button ion-button navPop icon-only>
            <ion-icon ios="ios-arrow-back" md="md-arrow-back"></ion-icon>
        </button>
    </ion-buttons>
    <ion-item color="danger" text-wrap>
     <ion-title >{{new.title}}</ion-title>
    </ion-item>
  </ion-toolbar>
</ion-header>

I tried add ion-item there, but still not working for me.
enter image description here

Update 2

.ios .toolbar-title {
   text-overflow: inherit;
   white-space: normal;
   text-align: left;
   font-size:1.3em;
}

.md .toolbar-title {
   text-overflow: inherit;
   white-space: normal;
   text-align: left;
   font-size:1.3em;
}

enter image description here

Solution

Pls update your css file as below :

.toolbar-title {
   text-overflow: inherit;
   white-space: normal;
}

Edited:

Or

.toolbar-title {
   text-overflow: unset;
   white-space: unset;
}

Answered By – Mankeomorakort

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published