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

Why Image And Button with Image looks differently in my layout

$
0
0

Hi,
I am newbie to this technology....

I am using Same Image i.e "Login.png" to my Image And Button also.

But my button looks me different than Image.

I think they both should look identical if my all properties are same...

Consider the following code.....

public HomePage()
{
var stack = new StackLayout
{

};

Image image = new Image
{
Source = new FileImageSource
{
File = Device.OnPlatform(iOS: "login_btn.png",
Android: "icon.png",
WinPhone: "Assets/ApplicationIcon.png")
},
HorizontalOptions = LayoutOptions.CenterAndExpand,
VerticalOptions = LayoutOptions.EndAndExpand
};

stack.Children.Add(image);

//Register button here....
    var btnRegister = new Button
    {
        Image = "login_btn.png",// "register_btn.png",//
        HorizontalOptions = LayoutOptions.Center,
        VerticalOptions = LayoutOptions.StartAndExpand,     
    };
    stack.Children.Add(btnRegister);

}

Now I have to llok both image and button looks exact same..
but getting button stretch down vertically.

Please Help me....

Thanks,


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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