这是我的代码,我试过 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 - 如何在 ion-header 中对长字符串进行自动换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何创建使用 Ionic 组件的自定义指令?)
将 ViewChild 用于动态元素 - Angular 2 &离子2Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(将 ViewChild 用于动态元素 - Angular 2 amp;离子2)
如何在 ionic2 中的 pop() 之后重新加载离子页面How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加载离子页面)
如何在 ionic2 中为 Web 应用程序管理多个滑块?How can manage multiple slider in ionic2 for web application?(如何在 ionic2 中为 Web 应用程序管理多个滑块?)
Javascript 将 URL 转换为 BASE64 图像Javascript Convert an URL to a BASE64 Image(Javascript 将 URL 转换为 BASE64 图像)
ionic 2 + angular 2:自动滚动到列表/页面/聊天的底部ionic 2 + angular 2 : auto scroll to bottom of list / page / chat(ionic 2 + angular 2:自动滚动到列表/页面/聊天的底部)