Change Screen 1 background colour?

Although I have made my own desktop apps in Xojo, I have never made an iOS app. I am struggling with how to change the background colour of the default Screen 1 in a new project.

Can anyone please help me?

Thanks in advance.

Download iOSDesignExtensions from

Add the modules you want to use but the following allows you to change the background

Sub SetBackgroundColorXC(extends v As MobileScreen, c As Color)

On the Opening Event of the MobileScreen name Screen1
Eg: Screen1.SetBackgroundColorXC(Color.Red)

2 Likes

Thanks - I will try that. Much appreciated.

1 Like

I recommend copy/pasting the entire iOSDesignExtensions folder into your own project.

You will then have more than a hundred extension methods you can use on all MobileUIControls and MobileScreen. All extension methods end with “XC” such as MobileScreen.SetBackgroundColorXC

The demo project showcases most of the available extensions.

3 Likes

Ok, so I copy the entire iOSDesignExtensions folder into my project.
Then in the Screen1 opening event, I paste the following code:

Sub SetBackgroundColorXC(extends v As MobileScreen, c As Color)
Screen1.SetBackgroundColorXC(Color.Red)

Have I understood that correctly?
Been a few years since I last used Xojo, and Im a bit rusty :slight_smile:

If your MobileScreen was named Screen1 and it was a property in a module or app. Then you can use that object. Eg. Module1.Screen1.Set…

Or if on the opening event,

Me.SetBackgroundColorXC(Color.Red)