Background color in a SwitchToDialog

asked Nov 27, 2019 in GUI Development by 3d.necronlord
I am using the "SwitchToDialog" to move between screens in my UI.  i have a day and a night mode so i have white and black backgrounds. when i start building it i started with black. my problem is when i am switching bettween 2 screens with white background (using a Fade_To_Right transition) i see a black background.

were i can modify the color so i can make it white?

1 Answer

0 votes
answered Nov 27, 2019 by Paul Banach


I suppose your GUI component has two rectangle views in the background. One is configured with white color and the other with black. Both are opaque, so you see the rectangle lying top (unless you make it invisible).

When running the transition, the opacity of the entire GUI component is modified. Modifying the opacity of the component affects in the practice the opacity of all views embedded inside it. In other words, the both rectangles in the background will become semi-transparent -> both are partially visible. You can see through the rectangle in the front the rectangle in the background.

What can you do?

- Show/Hide the rectangles exclusively. If you show white, hide the black rectangle. Or use one rectangle for both cases and modify its color only.

- If you have sufficient RAM, configure the transition to use the Buffered mode. With this mode the translucent effects are avoided. See also the explanation in Control the visibility of nested components. Buffered mode also helps to optimize the animation.

Does it help you further?

Best regards

Paul Banach

commented Nov 27, 2019 by 3d.necronlord
Actually I have a class as a background and there I have a variation. I am using styles to switch between the two modes, as I have a light sensor to drive this functionality.

I think this way I am showing the rectangles exclusively, correct?
commented Nov 27, 2019 by Paul Banach

without knowing your project it is not easy to say what going wrong. Are you sure the black rectangle is invisible? Can you try to set the rectangle e.g. blue and test the application again. The interseting question here: does the black rectangle cause the effect or are tere other views within the GUI component which being semi-transparent produce the effect.

Best regards

Paul Banach
commented Nov 27, 2019 by 3d.necronlord
i think the problem was that even if i had a style active the transition effect didn't read the variant of it but the original. i made a color switcher with a property observer and that looks like is working


 thank you

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint