Is there a way to stop longer Xamarin Shell tab titles being truncated?

会有一股神秘感。 提交于 2020-07-01 23:33:24

问题


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.

Longer title fitting on unselected tab.

Longer title being truncated when selected.


回答1:


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>


来源:https://stackoverflow.com/questions/57194140/is-there-a-way-to-stop-longer-xamarin-shell-tab-titles-being-truncated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!