【问题标题】:Is there a way to stop longer Xamarin Shell tab titles being truncated?有没有办法阻止更长的 Xamarin Shell 选项卡标题被截断?
【发布时间】:2019-12-03 06:28:42
【问题描述】:

我正在使用 Xamarin Shell 中的选项卡栏进行一些测试。如果标签的标题太长,即使有足够的空间来显示整个标题,它也会被截断。

有没有办法阻止文本被截断?

在我附加的图像中的示例中,只有在选择选项卡因为字体大小增加时,才会发生这种情况。但如果标题足够长,即使未选中选项卡也会发生这种情况。

Longer title fitting on unselected tab.

Longer title being truncated when selected.

【问题讨论】:

  • 当tab项被选中时,字体会变大,长文本难免会被截断,除非文本大小没有变化,或者长文本出现跑起来的效果灯笼。

标签: xamarin tabs xamarin.shell


【解决方案1】:

在styles.xml 中,在MainTheme.Base 样式中添加一个10sp。您还可以通过更改 colorPrimary 来更改选中时的颜色。

 <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">

    <!-- colorPrimary is used for the default action bar background -->
    <item name="colorPrimary">#3B9894</item>

    <item name="android:textAllCaps">false</item>

    <item name="colorAccent">#544B99</item>
    <item name="android:textSize">14sp</item>
  </style>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-05
    • 1970-01-01
    • 1970-01-01
    • 2020-11-03
    • 2013-08-20
    • 2011-02-24
    • 2021-10-05
    • 2011-01-25
    相关资源
    最近更新 更多