Bug 41877 - the Button show only half size when the page width more larger because not calculate original control padding(UWP)
Summary: the Button show only half size when the page width more larger because not ca...
Status: CONFIRMED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.0
Hardware: PC Windows
: Normal normal
Target Milestone: UWP
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-06-16 02:43 UTC by Mike
Modified: 2016-09-17 06:23 UTC (History)
2 users (show)

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


Attachments
Y:\Download (28.68 KB, application/x-zip-compressed)
2016-06-16 02:43 UTC, Mike
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 for Bug 41877 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Mike 2016-06-16 02:43:00 UTC
Created attachment 16351 [details]
Y:\Download

This is the XAML code:

<ContentPage>
 <StackLayout>
    <Label  Margin="6,20,0,0" Text="New Page Button Height Test (width more large, button height more small)"/>
    <Grid  Margin="6,10,0,0" HeightRequest="50">
      <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition/>
      </Grid.ColumnDefinitions>

      <Button Grid.Column="0" Text="Back" HorizontalOptions="Start"/>
      <Button Grid.Column="1" Text="Save" HorizontalOptions="End"/>
    </Grid>
    <ListView x:Name="lvLists" Margin="0,10,0,0">
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
              <Label Margin="10" Text="{Binding }" HorizontalOptions="StartAndExpand" />
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
  </StackLayout>
</ContentPage>



And this is the code:



public Page1 ()
        {
            InitializeComponent ();

            lvLists.ItemsSource = new ObservableCollection<string> { "Test1", "Test2", "Test3", "Test4", "Test5", "Test6", "Test7", "Test8", "Test9", "Test10", "Test11", "Test12", "Test13", "Test14", "Test15", "Test16", "Test17", "Test18", "Test19", "Test20", "Test21", "Test22", "Test23", "Test24", "Test2", "Test25" };
        }



The problem is :the Button height more small when the page width more larger, Is there anyone know what is the problem and how to fix it? Thank you.



More detail see the screenshot(on the attachment).
Comment 1 Mike 2016-06-23 13:27:20 UTC
This will fix it:


[assembly: ExportRenderer(typeof(Button), typeof(MyNamespace.CustomButtonRenderer))]
namespace MyNamespace.Renders
{
    public class CustomButtonRenderer : ButtonRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
        {
            base.OnElementChanged(e);

            if (null != Control)
             Control.Padding = new Windows.UI.Xaml.Thickness(0, 0, 0, 0);
        }


    }
}



But the problem is all button looks like very small.  

Obviously the problem source is : you guys not include the padding when calculate the size of all control. (Not only Button, maybe some other control also has the problem). That's why the original button always only show half because the original padding not include in calculate.



I hope you guys add "Padding" property for the control. that will fix problem.  Or....if you can't add the "Padding" right now, just temporarily fix the not calculate padding size problem.  Thank you.
Comment 2 Mike 2016-09-17 06:23:20 UTC
Hi, it's been long time after confirmed. Is this fixed now?