Bug 41241 - Custom Button Image Missized in Xamarin Forms Cross-platform in the WinPhone App
Summary: Custom Button Image Missized in Xamarin Forms Cross-platform in the WinPhone App
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-05-22 22:16 UTC by mwg@thoughts.net
Modified: 2016-07-07 15:19 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Button Images (1.55 KB, image/png)
2016-05-22 22:16 UTC, mwg@thoughts.net
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description mwg@thoughts.net 2016-05-22 22:16:02 UTC
Created attachment 16064 [details]
Button Images

Using the XAML block below in the MainPage.XAML of the PCL, the button image displays properly in the iOS and Android apps, but in the WinPhone app the image in the button is only a fifth of the button size and centered in the button. Screen snip attached.

<Button x:Name="Pre_authorize" Image="icon_tablet.png" Clicked="Click_Pre_Authorize" HorizontalOptions="Center" VerticalOptions="Center" BackgroundColor="#BFBEBED2" BorderColor="#BFBEBED2" IsVisible="True" Grid.Row="0" Grid.Column="0">
    <Button.WidthRequest>
        <OnPlatform x:TypeArguments="x:Double" WinPhone="133" iOS="80" Android="133"/>
    </Button.WidthRequest>
    <Button.HeightRequest>
        <OnPlatform x:TypeArguments="x:Double" WinPhone="112" iOS="80" Android="133"/>
    </Button.HeightRequest>
    <Button.BorderWidth>
        <OnPlatform x:TypeArguments="x:Double" WinPhone="1" iOS="1" Android="1"/>
    </Button.BorderWidth>
</Button> 

Using VS Enterprise 2015 v14.0.25123.00 Update 2 with the latest updates as of today.
Comment 1 Samantha Houts [MSFT] 2016-05-24 18:41:32 UTC

*** This bug has been marked as a duplicate of bug 27417 ***
Comment 2 E.Z. Hart [MSFT] 2016-06-01 19:17:56 UTC
Reopening to avoid confusion, since this is specific to Windows platforms.
Comment 3 Rui Marinho 2016-06-08 15:53:19 UTC
Should be fixed in 2.3.1-pre1
Comment 4 mwg@thoughts.net 2016-06-08 19:57:33 UTC
Yet to be released? I have Xamarin.Forms v2.3.0.46-pre3 installed and it was not working.
Comment 5 E.Z. Hart [MSFT] 2016-06-08 19:59:00 UTC
(In reply to mwg@thoughts.net from comment #4)
> Yet to be released? I have Xamarin.Forms v2.3.0.46-pre3 installed and it was
> not working.

Yes, it's not in 2.3.0.46-pre3. It should be in 2.3.1-pre1.
Comment 6 Parmendra Kumar 2016-07-07 15:19:18 UTC
I have checked this issue with Xamarin.Forms 2.3.1-pre2 and observed that this issue is working fine.

Screencast: http://www.screencast.com/t/w9MDJxMEB

Sample project: https://www.dropbox.com/s/3xr47w96svz5y4t/ImageButtonRecipe.zip?dl=0

Please follow the screencast and let me know If I can check anything else regarding the same.

Thanks.