When showing a modal screen as a popover or pageSheet (I can’t see the difference in these) is it possible to limit the hight so that more of the parent window is visible?
In my case the new window only has a few options to select and replaces what would be a popup menu in a desktop project.
If you are using iOSKit add this code after calling ShowModal:
Dim vc As new UIKit.UIViewController(screen.ViewControllerHandle)
Dim sz As Foundation.NSSize
sz = new Foundation.NSSize(540, 750) //width, height
vc.preferredContentSize = sz
There are other design techniques to do something similar with limited functionality.
If you create the popover UI in a MobileContainer (let’s call it ccPopup), you can make it to be modal in some way.
In your MobileScreen, place a full screen Container (let’s call it ccBackground) with a semi-transparent background color.
In ccBackground add ccPopup at a specified size and position.
ccBackground covers the entire screen, except for the NavigationBar, and forces the user to press some button to dismiss the popup.
With layout constraints in code. This is the code.
messageBox_YesNo_Container is the MobileContainer with the semi-transparent background and the message box. scrMessageBox is a global property (not sure if that’s relevant). ms is the active MobileScreen.
scrMessageBox = new MobileScrollableArea
var cc as new messageBox_YesNo_Container
scrMessageBox.Container = cc
ms.AddControl scrMessageBox
var consTop as new iOSLayoutConstraint(scrMessageBox, iOSLayoutConstraint.AttributeTypes.Top, _
iOSLayoutConstraint.RelationTypes.Equal, ms, iOSLayoutConstraint.AttributeTypes.Top, 1, 0)
var consBottom as new iOSLayoutConstraint(scrMessageBox, iOSLayoutConstraint.AttributeTypes.Bottom, _
iOSLayoutConstraint.RelationTypes.Equal, ms, iOSLayoutConstraint.AttributeTypes.Bottom, 1, 0)
ms.AddConstraint consTop
ms.AddConstraint consBottom