[英]Icons in FreshTabbedNavigationContainer tabs bar are giant in IOS
I am trying to show 4 icons for 4 tabs in the bar of my FreshTabbedNavigationContainer using FreshMVVM and Xamarin.Forms of course, they look as they should when I execute the app on an Android emulator, but when I use my Mac and emulate the app在 IOS 仿真器上,这些图标变得巨大,就像您在这张图片中看到的那样。 这是我的代码:FreshTabbedNavigationContainer 代码:
private static FreshTabbedNavigationContainer TabbedPageContainer = null;
TabbedPageContainer = new FreshTabbedNavigationContainer(navigation.ToString());
Products = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconHomeInverted.ico", null);
Discover = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconMagnifyingGlassInverted.ico", null);
Account = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconUserInverted.ico", null);
Settings = TabbedPageContainer.AddTab<HomeViewModel>(null, "IconSettingsInverted.ico", null);
#region UI
//Dissables swipe only in android because in IOS can not be done
TabbedPageContainer.On<Xamarin.Forms.PlatformConfiguration.Android>().SetIsSwipePagingEnabled(false);
TabbedPageContainer.BarTextColor = Color.FromHex("#FFFFFF");
#endregion
page.CoreMethods.SwitchOutRootNavigation(navigation.ToString());
我的图标位于“MyProject.IOS”中,它们不在资源文件夹或类似文件夹中。 就是这样,如果您需要更多信息,我会在看到您的请求后立即提供。 我希望你们都有美好的一天。
好的,我解决了,我的图标是 500x500 aprox,在 Windows 上,Visual Studio 或新的 MVVM 调整图像大小以填充选项卡栏; 这在 Mac 上不会发生,所以它们显示了它们的实际尺寸,我将它们调整为 38x38,现在它们看起来就像我想要的一样。
iOS“人机界面指南”为导航栏中的自定义图标提供了建议尺寸。
对于@1x 比例因子,这些尺寸 go 从 24 像素到 28 像素,这意味着对于其他比例因子,我们将有如下内容:
24px 48px@2x 72px@3x
28px 56px@2x 84px@3x
当然,您可以调整这些数字以保持整个应用程序的一致性。
更多关于这里的信息
希望这可以帮助。-
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.