3

I have a xamarin forms app where i need to add a toolbar item in the navigation bar. I have a multicolored image as the tool bar icon. When i run in android devices the exact image is being shown as the toolbar icon. However in iOS it is showing as a blue image. Is there any way to get the correct multicolored icon for iOS as well?

enter image description here

hashimks
  • 1,205
  • 2
  • 11
  • 29
  • provide screen shot and code what you have tried – Ziyad Godil Oct 04 '17 at 11:15
  • @ZiyadGodil This is the code i used And the image is attached in the question.. It shows the correct image in android. But in iOS the image color is completely blue. – hashimks Oct 04 '17 at 11:22
  • Verify image first, Is same image in android and iOS resource folder? – Ziyad Godil Oct 04 '17 at 11:43
  • @ZiyadGodil The images are same. It is a multicolored image. And there is a navigation bar tinting for iOS which caused the image to look default blue color in iOS. How to eliminate the navigation bar tinting for iOS in xamarin forms? – hashimks Oct 04 '17 at 11:52
  • @ZiyadGodil Hello.. Any updates? – hashimks Oct 04 '17 at 12:51
  • https://forums.xamarin.com/discussion/42587/toolbar-icon-showing-as-solid-color-on-ios-works-on-android – Ziyad Godil Oct 04 '17 at 13:05
  • @ZiyadGodil i saw this, but i did not get a workaround as I have a dual coloured image – hashimks Oct 05 '17 at 13:23
  • try with custom button and render platform specific. https://forums.xamarin.com/discussion/11003/navigationitem-button-with-custom-image-cant-see-image – Ziyad Godil Oct 06 '17 at 06:04

2 Answers2

0

When you create your pages using NavigationPage, Xamarin.Forms automatically creates a navigation bar on iOS. You can also modify quite a few things of the navigation bar, like this:

NavigationPage.SetBackButtonTitle(this, ""); // Empty text
NavigationPage.SetHasBackButton(this, false); // No back button
NavigationPage.SetTitleIcon (this, someIcon); // Set the icon
Ziyad Godil
  • 2,620
  • 1
  • 14
  • 36
0

try this code App.cs

MainPage = new NavigationPage(new PointOfSaleRMSApp.LoginPage())
{
    BarBackgroundColor = Color.FromHex("#34C4F9"),
    BarTextColor = Color.White
};
Lorenz Merdian
  • 722
  • 3
  • 14
  • 1
    Its not correct. This will change the Bar background color to the specified color and not the icon. I might have a multicolored icon but it is not possible to show as it is in this case also – hashimks May 24 '18 at 07:29