diff options
author | adrianknight89 <adrianknight89@outlook.com> | 2017-03-20 10:53:54 -0500 |
---|---|---|
committer | Rui Marinho <me@ruimarinho.net> | 2017-03-20 15:53:54 +0000 |
commit | ea4673c8cb3e9155a86abc7e8ae49655ee765d3b (patch) | |
tree | 776723057e8147aec2a19b0fc14d156ef0b7976c /Xamarin.Forms.Controls.Issues | |
parent | 04d034057c9743712d826c290bf9b1f2a0dd7924 (diff) | |
download | xamarin-forms-ea4673c8cb3e9155a86abc7e8ae49655ee765d3b.tar.gz xamarin-forms-ea4673c8cb3e9155a86abc7e8ae49655ee765d3b.tar.bz2 xamarin-forms-ea4673c8cb3e9155a86abc7e8ae49655ee765d3b.zip |
[iOS] Use UIButtonType.System for Button and utilize UIButton.Appearance (#554)
* Change button style and use UIButton appearance
* added sample code
* change references
* setting other properties
* add comment
* refactor proxy setter
* made control states array static
* remove category declaration
* changes
* add sample code
* changes
* Fix identation
* Update ButtonRenderer.cs
Diffstat (limited to 'Xamarin.Forms.Controls.Issues')
2 files changed, 114 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40251.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40251.cs new file mode 100644 index 00000000..64e9f667 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla40251.cs @@ -0,0 +1,113 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 40251, "Cannot style Buttons natively using UIButton.Appearance", PlatformAffected.iOS)] + public class Bugzilla40251 : TestNavigationPage // or TestMasterDetailPage, etc ... + { + protected override void Init() + { + PushAsync(new LandingPage40251()); + } + } + + [Preserve(AllMembers = true)] + public class LandingPage40251 : ContentPage + { + public LandingPage40251() + { + var stackLayout = new StackLayout + { + Orientation = StackOrientation.Vertical, + Spacing = 20, + VerticalOptions = LayoutOptions.Center + }; + + var label0 = new Label + { + Text = "Each label below will update UIButton.Appearance proxy. When you remove the page from the stack, the original value will be set again.", + HorizontalTextAlignment = TextAlignment.Center + }; + stackLayout.Children.Add(label0); + + var label1 = new Label + { + Text = "TitleColor", + HorizontalTextAlignment = TextAlignment.Center + }; + var t1 = new TapGestureRecognizer(); + t1.Tapped += T_Tapped; + label1.GestureRecognizers.Add(t1); + stackLayout.Children.Add(label1); + + var label2 = new Label + { + Text = "TitleShadowColor", + HorizontalTextAlignment = TextAlignment.Center + }; + var t2 = new TapGestureRecognizer(); + t2.Tapped += T_Tapped2; + label2.GestureRecognizers.Add(t2); + stackLayout.Children.Add(label2); + + var label3 = new Label + { + Text = "BackgroundImage", + HorizontalTextAlignment = TextAlignment.Center + }; + var t3 = new TapGestureRecognizer(); + t3.Tapped += T_Tapped3; + label3.GestureRecognizers.Add(t3); + stackLayout.Children.Add(label3); + + Content = stackLayout; + } + + private async void T_Tapped(object sender, EventArgs e) + { + await Navigation.PushAsync(new TestPage40251("TitleColor")); + } + + private async void T_Tapped2(object sender, EventArgs e) + { + await Navigation.PushAsync(new TestPage40251("TitleShadowColor")); + } + + private async void T_Tapped3(object sender, EventArgs e) + { + await Navigation.PushAsync(new TestPage40251("BackgroundImage")); + } + } + + [Preserve(AllMembers = true)] + public class TestPage40251 : ContentPage + { + public static string Arg; + + public TestPage40251(string arg) + { + Arg = arg; + + Content = new ContentView + { + Content = new Button + { + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.Center, + Text = "Button", + BackgroundColor = Color.Black, + WidthRequest = 250, + HeightRequest = 50 + } + }; + } + } +}
\ No newline at end of file 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 23fc5381..d8b688dd 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 @@ -116,6 +116,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40173.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39821.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40185.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40251.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40333.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla31806.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla40408.cs" /> |