簡體   English   中英

FreshTabbedNavigationContainer 標簽欄中的圖標在 IOS 中是巨大的

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM