有没有办法阻止更长的 Xamarin Shell 选项卡标题被截断? [英] Is there a way to stop longer Xamarin Shell tab titles being truncated?

查看:21
本文介绍了有没有办法阻止更长的 Xamarin Shell 选项卡标题被截断?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm doing some testing with the Tab Bar in Xamarin Shell. If the tab's title is too long it gets truncated even though there is clearly more than enough room to show the whole title.

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

Is there a way to stop the text being truncated?

在我所附图片的示例中,仅当由于字体大小增加而选择选项卡时才会发生这种情况.但如果标题足够长,即使未选择选项卡也可能发生.

In the example in the images I've attached, this happens only when the tab is selected because of the font size increase. But can happen even when the tab is unselected if the title is long enough.

更长的标题适合未选中的标签.

较长的标题在选择时被截断.

推荐答案

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

In styles.xml add a 10sp in your MainTheme.Base style. You can also change the color when selected by changing 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>

这篇关于有没有办法阻止更长的 Xamarin Shell 选项卡标题被截断?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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