Android Question B4XSwitch color when Value=true and Enabled=False

abilio486software

Active Member
Licensed User
It is possible to have a differente graphic aspect when

B4X:
B4XSwitch.Value=True AND B4XSwitch.Enabled=False

It causes a green filled area, and it's not so explicit at all

It is possible to have abetter design for that state?
 

Attachments

  • Captura de ecrã 2021-03-09 094111.png
    Captura de ecrã 2021-03-09 094111.png
    10.4 KB · Views: 131

Mahares

Expert
Licensed User
Longtime User
It is possible to have abetter design for that state?
In the designer properties of the B4XSwitch , you can change the colors of the ON color, OFF color and THUMB color. Make sure your thumb color is not the same as the ON color. That is why you are getting that all green effect.
 
Upvote 0

abilio486software

Active Member
Licensed User
Maby thanks, but it seems that didn't resolve

Thumb color should be white.

I think it is missing in the designer a thumb color for the "Enabled=False" state.

In XCode it exists, but here I don't find him.

How can I setup a thumb color for disabled state?


1615293091237.png
 
Last edited:
Upvote 0

abilio486software

Active Member
Licensed User
B4XSwitch is a custom drawn view.

The regular B4i Switch is a native UISwitch.

Many thanks Erel 🙏

My project is in B4A, I'm trying to resolve this behavior on Android.

How can I have different colors for disabled state, to avoid to have the switch filled with only one color, when B4XSwitch.Enabled=False ?
 
Last edited:
Upvote 0

abilio486software

Active Member
Licensed User
Take the source code and modify it. It is inside XUI Views.b4xlib.
Thanks,

I will then try to change the library. I already understood that I can unzip and see the source code.

But I think that as a base library it should be changed for everyone and not an adapted version, because Enabled is an obvious state in such an object.

If I can change it, I will send you the source code to improve the base library.
 
Upvote 0
Top