如何使文本完全显示在 IconTabBar 中? [英] How to make text appear fully in IconTabBar?

查看:39
本文介绍了如何使文本完全显示在 IconTabBar 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序和文本中使用 IconTabBar选项卡的标题)未完全显示.一半的文字被剪掉了.

I am using IconTabBar in my application and the text (heading for the tab) is not displaying fully. Half of the text gets cut.

<IconTabBar class="sapUiResponsiveContentPadding">
  <items>
    <IconTabFilter
      icon="sap-icon://approvals"
      text="Set Values for Mass Change" design="Horizontal"
    >
      <mvc:XMLView viewName="abc.view.selectionPage"/>
    </IconTabFilter>
    <IconTabSeparator icon="sap-icon://open-command-field"/>
  </items>
</IconTabBar>

所以这里应该是设置质量变化值"的文本输出为设置质量值..."

So here the text, which should be "Set Values for Mass Change", is output as "Set Values for Mass..."

推荐答案

由于类中设置了两个属性,文本被切成两半:

The text is cut in half due to two properties set in the classes :

  1. sapMITBHorizo​​ntalWrapper(用于 Wrapper Div)和
  2. sapMITBHorizo​​ntal.sapMITBFilter>.sapMITBHorizo​​ntalWrapper>.sapMITBText(显示文本的最大宽度)

这里,max-width 设置为 7.5rem,text-overflow 设置为:省略号.

Here, max-width is set to 7.5rem and text-overflow is set to : ellipsis.

不知何故,无法将类添加到 IconTabFilter(坏),但您可以将类添加到 IconTabBar.所以,为了解决这个问题,我将最大宽度增加到 10rem.您可以增加和减少 max-width 以满足您的要求.

Somehow, its not possible to add a class to IconTabFilter (bad) but you can add class to IconTabBar. So, to solve this I've increased the max-width to 10rem. You can increase and decrease max-width to suit your requirements.

下面是css代码:

.myWidth .sapMITBHorizontalWrapper {
    max-width: 10rem;
}

.myWidth .sapMITBHorizontal.sapMITBFilter>.sapMITBHorizontalWrapper>.sapMITBText {
    max-width: 10rem;
}

查看:

<IconTabBar class="sapUiResponsiveContentPadding myWidth">
                    <items>
                        <IconTabFilter id='myId' icon="sap-icon://approvals" class='' text="Set Values for Mass Change" design="Horizontal">
                           <!--  <mvc:XMLView viewName="abc.view.selectionPage"/> -->
                        </IconTabFilter>
                        <IconTabSeparator icon="sap-icon://open-command-field"/>
                         <IconTabFilter  icon="sap-icon://approvals" class='' text="Short Text" design="Horizontal">
                           <!--  <mvc:XMLView viewName="abc.view.selectionPage"/> -->
                        </IconTabFilter>
                        <IconTabFilter  icon="sap-icon://approvals" class='' text="Shorter" design="Horizontal">
                           <!--  <mvc:XMLView viewName="abc.view.selectionPage"/> -->
                        </IconTabFilter>

                        <IconTabFilter  icon="sap-icon://approvals" class='' text="This is a Big text." design="Horizontal">
                           <!--  <mvc:XMLView viewName="abc.view.selectionPage"/> -->
                        </IconTabFilter>
                        <IconTabFilter  icon="sap-icon://approvals" class='' text="Lil" design="Horizontal">
                           <!--  <mvc:XMLView viewName="abc.view.selectionPage"/> -->
                        </IconTabFilter>
                    </items>
                </IconTabBar>

这篇关于如何使文本完全显示在 IconTabBar 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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