ionic-如何在离子头中将长字符串自动换行 [英] ionic - How to wordwrap a long string in ion-header

查看:123
本文介绍了ionic-如何在离子头中将长字符串自动换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码,我尝试text-wrap,在ion-header内仍然无法显示整个标题.

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>

更新

<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>

我尝试在其中添加ion-item,但仍然无法为我工作.

I tried add ion-item there, but still not working for me.

更新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;
}

推荐答案

请按如下所示更新您的css文件:

Pls update your css file as below :

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

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

这篇关于ionic-如何在离子头中将长字符串自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆