您可以自定义ShellRendererText
来修改更多选项卡。
AndroidCustomShellRenderer.cs
中的解决方案:
public class CustomShellRenderer : ShellRenderer
{
public CustomShellRenderer(Context context) : base(context)
{
}
protected override IShellBottomNavViewAppearanceTracker CreateBottomNavViewAppearanceTracker(ShellItem shellItem)
{
return new MarginedTabBarAppearance();
}
}
public class MarginedTabBarAppearance : IShellBottomNavViewAppearanceTracker
{
public void Dispose()
{
}
public void ResetAppearance(BottomNavigationView bottomView)
{
}
public void SetAppearance(BottomNavigationView bottomView, ShellAppearance appearance)
{
}
public void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
{
if(null != bottomView.Menu.GetItem(4))
{
IMenuItem menuItem = bottomView.Menu.GetItem(4);
menuItem.SetTitle(Resource.String.More);
}
}
}
strings.xml:_
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<string name="More">Mehr</string>
</resources>
效果:

iOSCustomShellRenderer.cs
中的解决方案:
public class CustomShellRenderer: ShellRenderer
{
protected override IShellTabBarAppearanceTracker CreateTabBarAppearanceTracker()
{
return new TabBarAppearance();
}
}
public class TabBarAppearance : IShellTabBarAppearanceTracker
{
public void Dispose()
{
}
public void ResetAppearance(UITabBarController controller)
{
}
public void SetAppearance(UITabBarController controller, ShellAppearance appearance)
{
}
public void UpdateLayout(UITabBarController controller)
{
UITabBar tb = controller.MoreNavigationController.TabBarController.TabBar;
if (tb.Subviews.Length > 4)
{
UIView tbb = tb.Subviews[4];
UILabel label = (UILabel)tbb.Subviews[1];
label.Text = "Mehr";
}
}
}
效果:

以上代码基于这个官方示例项目(Xamarin.Forms - Xaminals)。