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

Button with an image, how to centre the image horizontally?

$
0
0

Hi guys,
Trying to get a little button with an image, I want the image to be centred within the button but it is always to the left.

        Button button = new Button();
        {
            //WidthRequest = 50
            BorderWidth = 0.5,
            BorderColor = Color.Gray,
            HorizontalOptions = LayoutOptions.Center,
            VerticalOptions = LayoutOptions.CenterAndExpand
        };
        button = (FileImageSource) ImageSource.FromFile("Images/image1.png");

Also strangely enough, the image is displaying in blue. The image is mostly gray...


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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