Search code examples
imagemobilesharedtizen

Image in Tizen Mobile is not visible


I am using <Image Source="flower.png" /> code in Xamarin form in Visual Studio 2017 to show image in Tizen Mobile but it does not show up. I put image file in shared\res folder in Tizen project.


Solution

  • Copy the Image into '.TizenMobile' Project 'res' directory (not in 'shared>res' only 'res' (root)). Then In Solution Explorer:Right click over 'res' folder and Add > Existing Item > png Image

    In your ProjectCode (Portable) C# file:

     MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                            new Image {
                                Aspect = Aspect.AspectFit,
                                Source = ImageSource.FromFile("flower.png")
                            }
                    }
                }
            };
    

    Or you can even try the XAML.

    enter image description here