Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to set icon on navigation bar dynamically for android ?

$
0
0

Hi all,
I want to set icon on navigation bar at run time. My icon is in Base64 format & I have converted it in image format by using converter.

var image = new Image
{
};
image.SetBinding(Image.SourceProperty, new Binding(Settings.CompanyLogo, BindingMode.Default, new Converters.Base64ImageSourceConverter(), null, null));

And now I am setting it on navigation bar as follows.

NavigationPage.SetTitleIcon(this, image);

But it is not working because the 2nd parameter should be the name of image in string format like :

NavigationPage.SetTitleIcon(this, "icon.png");

And I am getting the icon from api service in Base64 string format.

So please let me know how to fix this ?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>