Android Question AppCompat: ACSwitch color problem?

Black&WhiteStar

New Member
Hi all!

In the app I am developing the ACSwitches seem to behave a little strange.
As you can see in the example project attached, I load a layout that has some switches in it.
The problem is that the first switch always starts with a white color, while the others get their colors from the application theme that I defined in the manifest (as I suppose it should be their normal behavior).
If you try to reload the same layout a second time, this issue disappear.

Am I making some weird mistake that I'm not aware of? Or am I using the AppCompat library in the wrong way?
Any ideas, thoughts?

Thanks all.
 

Attachments

  • Prova.zip
    13.1 KB · Views: 43

Black&WhiteStar

New Member
Actually I figured out what was the issue there.

I forgot to add the specific line of code for the AppCompat library to work properly (as explained here):
B4X:
#Extends: android.support.v7.app.AppCompatActivity

In my example project (and also in my main project) I only used the code
B4X:
#AdditionalJar: com.android.support:support-compat
that was a leftover of me trying to change the CheckBoxes and EditTexts color (https://www.b4x.com/android/forum/threads/change-edittext-colors.87653/ - https://www.b4x.com/android/forum/threads/change-checkbox-colors.105575/).

Now I am using both lines and the problem never occurred again.
 
Upvote 0
Top