iOS dark mode

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Volker
Posts: 11
Joined: Tue Jan 28, 2020 11:52 am

iOS dark mode

Post by Volker » Fri Aug 28, 2020 5:06 am

Hello,
You can now use the systemAppearance property to query the current dark or light appearance. I always get - light - even though I have switched on dark mode.
Does anyone have a similar problem?
How did you solve it? Is now mandatory in the AppStore.
Greetings Volker

friccio
Posts: 2
Joined: Wed Feb 19, 2020 4:19 pm

Re: iOS dark mode

Post by friccio » Sat Feb 27, 2021 8:00 pm

Hi,

I have the same problem, did you find any solution?

Thanks

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 133
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: iOS dark mode

Post by bobcole » Mon Mar 01, 2021 6:30 am

Try this in the Message Box:

Code: Select all

put the systemAppearance into message box
LiveCode responds with the correct setting when I switch between Light and Dark in Systems Preferences > General preference pane.
I'm using LC 9.6.2-rc-2 on a Mac Mini (M1).
Bob

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: iOS dark mode

Post by richmond62 » Mon Mar 01, 2021 4:33 pm

Works for me.

I'm using LC 9.6.2-rc-2 on a Mac Mini (2018 Intel, MacOS 11.3 Beta 2).

Mind you, reporting the systemAppearance is just the start, if you
want your stack to "go black" you will have to do quite a lot of heavy lifting . . .

Code: Select all

on openCard
   put the systemAppearance into MACLOOK
   if MACLOOK contains "dark" then
      set the backgroundColor of card "KARD1" to black
      set the backgroundColor of fld "INP" to black
      set the borderColor of fld "INP" to white
      set the textColor of fld "INP" to white
   else
      set the backgroundColor of card "KARD1" to white
      set the backgroundColor of fld "INP" to white
      set the borderColor of fld "INP" to black
      set the textColor of fld "INP" to black
   end if
end openCard
That code will NOT switch the stack's appearance if dark mode is switched while the stack is loaded
[this is on a Macintosh, not in iOS]
-
Screenshot 2021-03-01 at 17.42.14.png
Screenshot 2021-03-01 at 17.42.44.png
-
Attachments
SYSAPP.livecode.zip
Here's the stack.
(983 Bytes) Downloaded 146 times

Post Reply

Return to “iOS Deployment”