summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.MacOS/Platform.cs
diff options
context:
space:
mode:
authorRoger Hardiman <RogerHardiman@users.noreply.github.com>2017-09-01 16:27:13 +0100
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 13:29:51 +0900
commit271c7bedac336ce96cc01ef8aec3e134d6b2a688 (patch)
tree646ee46bc1a621e883947d1c315e24f17aa6bd76 /Xamarin.Forms.Platform.MacOS/Platform.cs
parentfb5005ad412f20be64948c3c5814e4ea983bf44e (diff)
downloadxamarin-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.Platform.MacOS/Platform.cs')
-rw-r--r--Xamarin.Forms.Platform.MacOS/Platform.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.MacOS/Platform.cs b/Xamarin.Forms.Platform.MacOS/Platform.cs
index 7e853ac4..f936a320 100644
--- a/Xamarin.Forms.Platform.MacOS/Platform.cs
+++ b/Xamarin.Forms.Platform.MacOS/Platform.cs
@@ -43,7 +43,17 @@ namespace Xamarin.Forms.Platform.MacOS
var alert = NSAlert.WithMessage(arguments.Title, arguments.Cancel, arguments.Destruction, null, "");
if (arguments.Buttons != null)
{
- alert.AccessoryView = GetExtraButton(arguments);
+ int maxScrollHeight = (int)(0.6 * NSScreen.MainScreen.Frame.Height);
+ NSView extraButtons = GetExtraButton(arguments);
+ if (extraButtons.Frame.Height > maxScrollHeight) {
+ NSScrollView scrollView = new NSScrollView();
+ scrollView.Frame = new RectangleF(0, 0, extraButtons.Frame.Width, maxScrollHeight);
+ scrollView.DocumentView = extraButtons;
+ scrollView.HasVerticalScroller = true;
+ alert.AccessoryView = scrollView;
+ } else {
+ alert.AccessoryView = extraButtons;
+ }
alert.Layout();
}