Forum Xamarin Xamarin.Forms

Setting Image Source from Codebehind is not working

JassimRahmaJassimRahma USMember ✭✭✭✭
edited April 2019 in Xamarin.Forms


I am using below code to set the Image source from codebehind:

ImageWeather.Source = string.Format("weather_icon_{0}", ImageSource.FromResource([0].icon));

The image file name in my Resources folder is weather_icon_01n.png and the result I am getting from my json is 01n.png that's why I set it using the above code using string.Format so the name will be weather_icon_01n.png

but I am not getting the iage displayed nor getting any error message

where is the issue here?


Best Answer


Sign In or Register to comment.