Modal Screen in Different Sizes?

iPad app:

It’s possible to make a screen and then showModal. The screen then covers most of the surface, and when it’s closed the previous screen (which was mainly hidden) is fully visible again.

The question: Is it possible to make the “modal screen” smaller?

The iPad app I’m working on has a bunch of user-settable items. Currently they’re all on one screen (separated by lines), but I think things would look and work better if they were on separate screens. The problem is that most of them contain few controls, and I think they would look silly on the standard size modal screen.

Yes there is a way to change the size of the modal size. Not at my desk right now. Will post some code very soon.
It might actually be in iOSDesignExtensions. SetModalSizeXC maybe?

Slight thread hijack: I can make a new screen that I “push” look pretty much identical to a modal screen and often use that. Why? Because if the screen you’re returning to needs to update, this just happens. With a modal screen, the Activate event doesn’t fire on the first screen.

I put this change code in the Modal Screen’s Deactivated Event, which DOES fire.

Just checked, iOSDesignExtensions has a SetPreferredContentSizeXC method.

Use it like this:

Var modal as New ScreenModal

modal.ShowModal(self, MobileScreen.ModalPresentationStyles.FormSheet) //first show the modal screen
//Then change its size
if self.ContentSize.Width > 540 then
  modal.SetPreferredContentSizeXC(new Size(540, 620)) //Change size here
End if

3 Likes