diff options
author | Roger Hardiman <RogerHardiman@users.noreply.github.com> | 2017-09-01 16:27:13 +0100 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-10-23 13:29:51 +0900 |
commit | 271c7bedac336ce96cc01ef8aec3e134d6b2a688 (patch) | |
tree | 646ee46bc1a621e883947d1c315e24f17aa6bd76 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared | |
parent | fb5005ad412f20be64948c3c5814e4ea983bf44e (diff) | |
download | xamarin-forms-271c7bedac336ce96cc01ef8aec3e134d6b2a688.tar.gz xamarin-forms-271c7bedac336ce96cc01ef8aec3e134d6b2a688.tar.bz2 xamarin-forms-271c7bedac336ce96cc01ef8aec3e134d6b2a688.zip |
[MacOS] Fix bugzilla58779 (#1109)
* Add test for B58779 - DisplayActionSheet bug on MacOS
When there are a large number of items in the list (eg 15) the list goes off the bottom of the Mac desktop
* Add test for B58799 to project
* Fix for B58799
If the list of buttons has a height > 400 then put the list in a NSScrollView
* Fix whitespace for Bugzilla 58779
* Add vertical scrollbar
* Set height of scrollview to 60% of the screen height
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared')
2 files changed, 68 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla58779.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla58779.cs new file mode 100644 index 00000000..e83f5012 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla58779.cs @@ -0,0 +1,67 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; +using System.Collections.ObjectModel; +using System; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Bugzilla, 58779, "[MacOS] DisplayActionSheet on MacOS needs scroll bars if list is long", PlatformAffected.All)] + public class Bugzilla58779 : TestContentPage + { + const string ButtonId = "button"; + + protected override void Init() + { + Button button = new Button + { + Text = "Click Here", + Font = Font.SystemFontOfSize(NamedSize.Large), + BorderWidth = 1, + HorizontalOptions = LayoutOptions.Center, + VerticalOptions = LayoutOptions.CenterAndExpand, + AutomationId = ButtonId, + }; + + // The root page of your application + var content = new StackLayout { + VerticalOptions = LayoutOptions.Center, + Children = { + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "Tap on the button to show the DisplayActionSheet with 15 items" + }, + new Label { + HorizontalTextAlignment = TextAlignment.Center, + Text = "The list of items should be scrollable and Cancel should be visible" + }, + button + + } + }; + + button.Clicked += (sender, e) => { + String[] string_array = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"}; + this.DisplayActionSheet("title","cancel","destruction",string_array); + }; + + Content = content; + } + + +#if UITEST + [Test] + public void Bugzilla58779Test() + { + RunningApp.WaitForElement(q => q.Marked(ButtonId)); + RunningApp.Tap(q => q.Marked(ButtonId)); + RunningApp.Screenshot ("Check list fits on screen"); + } +#endif + } +}
\ 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 7da67781..3009556f 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 @@ -602,6 +602,7 @@ <Compile Include="$(MSBuildThisFileDirectory)Bugzilla52700.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Bugzilla39407.cs" /> <Compile Include="$(MSBuildThisFileDirectory)ButtonFastRendererTest.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Bugzilla58779.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="$(MSBuildThisFileDirectory)Bugzilla22229.xaml"> |