Changing the color of an internally programmed modal

Why can’t I find in all your documentaton how to change the color of a modal?

Given:

Var modal As New ModalScreen
modal.ShowModal

I want to change the color of ModalScreen – How?

Set the backcolor property in the IDE?

Is ModalScreen a DesktopWindow type ‘Modal Dialog’?

Have you tried something like this?

Var modal As New ModalScreen
modal.HasBackgroundColor = True
modal.BackgroundColor = Color.Red
modal.Show

Copy/Pasted your code,I get two errors:

Type “ModalScreen.ModalScreen” has no member named “HasBackgroundColor”
Type “ModalScreen.ModalScreen” has no member named “BackgroundColor”

What is ModalScreen?

If I copy your code I get this error:
image


Using the code I posted on a Mac, and ModalScreen is a DesktopWindow type ‘Modal Dialog’ with no background:

I get this modal over Window1:
image

The code is from the Examples → iOS → ShowModal.
The exact code is in the Pressed event for the “ShowModal” button (Button1)

Xojo can create apps for Desktop, Web and iOS. As you didn’t provide the information before, I assumed your target was Desktop. Sorry about that.

I don’t know anything about Xojo iOS. I hope someone else can help you.

If you post in the ‘Getting Started’ forum is good to provide a little more information about your issue, like Target, Xojo version, in which OS are you running Xojo, for example.

1 Like

it seems it have only a TintColor propertie

Go get Jérémie Leroy’s iOSDesignExtensions. He has covered a lot of things that are missing from the base product.

1 Like

As Greg just mentioned, my iosdesignextensions modules will be a great help to change the UI of an iOS app.

After importing iosdesignextensions in your project, you should be able to use:

Var modal As New ModalScreen
modal.ShowModal
modal.SetBackgroundColorXC(&cFF0000)

Most iosdesignextensions methods (function names) start with Set… and end with XC

I downloaded your impressive project about a week ago. I want to figure out how your “Open Settings” feature workds (Under “Application Extentions”) and if I can, will use that to place controls on instead of a dialog.

Thanks for your iOS Design Extenstions!

With iOSDesignExtensions, App.OpeniOSSettingsXC will only open the default iOS settings for the App. Adding items to the default settings involves changing your App’s plist and is considered an advanced feature.
You are better off making your own dialog to manage settings, like I do in most of my apps.
If you are curious to see what can be made with Xojo & iOSDesignExtensions, check out Packr.