In addition to using the visibility attribute of an object in <Command> to control the object visibility, you can also set the visibility parameter in objects such as images and text to control the object visibility.
Implement switchover between light and dark modes according to the time.
<Image x="" y="" w="" h="" align="" antiAlias="" visibility=""/> <Text x="" y="" align="" alignV="" color="" size="" textExp="" visibility=""/>
Parameter | Type | Mandatory | Description |
|---|---|---|---|
visibility | Expression | Yes | Object visibility. If this parameter is set to true or a positive value, the object is visible. If this parameter is set to false, 0, or a negative value, the object is invisible. Expressions are supported. |
Use custom variables to control visibility of text and images.
<Image x="100" y="750" centerX="136" centerY="151" src="dog.png" visibility = "true"/> <Image name="sun" x="350" y="550" w="828*0.4" h="828*0.4" centerX="136" centerY="151" src="cake.png" visibility="1"/> <Var name="isVisibility" expression="1"/> <Text x="540" y="500" color="#00ff00" size="60" text="Visible when you tap the upper part of the screen" ign="center" visibility="eq(#isVisibility,1)"/>