Problems rendering image button

Hello,

I have created three image buttons with Forms. In iOS its works but in Android the image is bigger than expected and the resolution is not the expected.

The code is XAML:

<Button x:Name="facebookButton"
                Command="{ Binding OnFacebook }"
                Image="nodpi/login_facebook"
                BackgroundColor="Transparent"
                RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.15}"
                RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.15}"
                RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.14}"
                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.76}" />

Code behind:
this.facebookButton.Image = (FileImageSource)Device.OnPlatform (ImageSource.FromFile ("nodpi/login_facebook"), ImageSource.FromFile ("login_facebook"), ImageSource.FromFile ("Images/login_facebook"));

What could be the problem with Android resources?``

Best Answer

Answers

Sign In or Register to comment.