问题
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