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

Xamarin.Forms.Image usage in Android

$
0
0

Hey ,

here is my simple button with image :

    var search = new Button {
                Text = "SEARCH",
                VerticalOptions = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.EndAndExpand,
                Image = "search.png",
                WidthRequest = 150
            };
            var searchLt = new StackLayout {
                HorizontalOptions = LayoutOptions.EndAndExpand,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Spacing = 10,
                Children = { search }
            };
            var header = new StackLayout {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                Padding = 5,
                Children = { barcodeLt, searchLt }
            };

in ios it works fine, but in android image is not displayed. I have search.png inside Resources/drawable -> built action : AndroidResources.

I have no idea why it isn't shown :(


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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