diff options
author | Samantha Houts <samantha@teamredwall.com> | 2016-03-31 10:43:59 -0700 |
---|---|---|
committer | Samantha Houts <samantha@teamredwall.com> | 2016-03-31 10:43:59 -0700 |
commit | d22a5c7c32701aa6b830b09e52d8e272a9d0a97f (patch) | |
tree | df0b2e44d1d71fbc32b55cd16ead8ccb69d36e30 /Xamarin.Forms.Controls.Issues | |
parent | 850591679f51ed27cf00707296156ab4ed363873 (diff) | |
parent | 17e2a4b94d5105b53c5875d9416d043f14313305 (diff) | |
download | xamarin-forms-d22a5c7c32701aa6b830b09e52d8e272a9d0a97f.tar.gz xamarin-forms-d22a5c7c32701aa6b830b09e52d8e272a9d0a97f.tar.bz2 xamarin-forms-d22a5c7c32701aa6b830b09e52d8e272a9d0a97f.zip |
Merge pull request #11 from xamarin/fix-bugzilla27417
Add options for specifying layout of button text/image content
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
4 files changed, 105 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417.cs new file mode 100644 index 00000000..4f01a63d --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417.cs @@ -0,0 +1,59 @@ +using Xamarin.Forms.CustomAttributes; + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 27417, + "Button.Image behaviors differently on each platform and has extra padding even with no Text", PlatformAffected.All)] + public class Bugzilla27417 : TestContentPage + { + protected override void Init() + { + var instructions = new Label { Text = @"There should be 6 buttons below. +The first button should have the text 'Click Me' in the center. +The second button should have an image in the center and no text. +The third button should have the image on the left and the text on the right. +The fourth button should have the image on the top and the text on the bottom. +The fifth button should have the image on the right and the text on the left. +The sixth button should have the image on the bottom and the text on the top." }; + + Content = new StackLayout + { + Spacing = 10, + Children = + { + instructions, + new ScrollView + { + Content = new StackLayout + { + Spacing = 10, + VerticalOptions = LayoutOptions.Center, + HorizontalOptions = LayoutOptions.Center, + Children = + { + new Button { Text = "Click Me", BackgroundColor = Color.Gray }, + new Button { Image = "coffee.png", BackgroundColor = Color.Gray }, + CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 10)), + CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 10)), + CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 10)), + CreateButton(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Right, 10)) + } + } + } + } + }; + } + + static Button CreateButton(Button.ButtonContentLayout layout) + { + return new Button + { + Text = "Click Me", + Image = "coffee.png", + ContentLayout = layout, + BackgroundColor = Color.Gray + }; + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml new file mode 100644 index 00000000..ab652b30 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="Xamarin.Forms.Controls.Issues.Bugzilla27417Xaml"> + <StackLayout Spacing="10"> + + <Button BackgroundColor="Color.Gray" Text="Click Me"></Button> + <Button BackgroundColor="Color.Gray" Image="coffee.png"></Button> + <Button BackgroundColor="Color.Gray" Image="coffee.png" Text="Click Me"></Button> + <Button BackgroundColor="Color.Gray" Image="coffee.png" Text="Click Me" ContentLayout="Top,10"></Button> + <Button BackgroundColor="Color.Gray" Image="coffee.png" Text="Click Me" ContentLayout="Bottom,10"></Button> + <Button BackgroundColor="Color.Gray" Image="coffee.png" Text="Click Me" ContentLayout="Right"></Button> + + </StackLayout> +</ContentPage>
\ No newline at end of file diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml.cs new file mode 100644 index 00000000..96d2ac45 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla27417Xaml.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; + +namespace Xamarin.Forms.Controls.Issues +{ + public partial class Bugzilla27417Xaml : ContentPage + { + public Bugzilla27417Xaml () + { +#if APP + InitializeComponent (); +#endif + } + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index b22ed58b..fcc45935 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -24,6 +24,11 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla26501.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla26868.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla27378.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla27417.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla27417Xaml.xaml.cs"> + <DependentUpon>Bugzilla27417Xaml.xaml</DependentUpon> + <SubType>Code</SubType> + </Compile> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla27581.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla28570.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla28796.cs" /> @@ -491,4 +496,10 @@ <Generator>MSBuild:UpdateDesignTimeXaml</Generator> </EmbeddedResource> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla27417Xaml.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + </EmbeddedResource> + </ItemGroup> </Project>
\ No newline at end of file |