iOS Question Switch

moore_it

Well-Known Member
Licensed User
Longtime User
Hello,

please help me, how works switch ?

I try this but not work,

sub sw1_valuechanged(value as boolean)
sw1.value = value
and sub

thanks guy ...
 

klaus

Expert
Licensed User
Longtime User
What exactly do you want to do ?
The sw1_ValueChanged event routine is called when you click on the switch and Value returns the switch state.
If the switch is 'ON' Value = True.
If the switch is 'OFF' Value = False.
It's similar to the CheckBox in B4A.
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
Hi Klaus,

in an pane ia have a switch, if is true when i click on a button go to sub a if switch is false go to sub b ....
but the switch not work in this mode it's every false (the default state)
I don't understand how it work.

thanks
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
This is the view , when i click on button in right bottom, if the switch is on go to 'sub a' if it off go to 'sub b'.
But if i set switch on, when i click the button the value is always off ....

why ?
 

Attachments

  • IMG_1694.PNG
    IMG_1694.PNG
    48.1 KB · Views: 264
Upvote 0

klaus

Expert
Licensed User
Longtime User
What happens when you click on the Switch ?
Does it change or not.
Otherwise post your project (IDE menu File / Export As Zip) so we can see what you have done and how.
 
Upvote 0

moore_it

Well-Known Member
Licensed User
Longtime User
yes it change
i change in on state
but when i click on bottom right button ... switch value is false
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
When you zip a project you should do it in the IDE menu File / Export As Zip, as already suggested in post #6.
This way all relevant files are included.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
In such cases it might be interesting to make a smaller project showing the problem.
And sometimes, the small one works OK and allows to find the problem (personal experience).
 
Upvote 0

tcgoh

Active Member
Licensed User
Longtime User
Is it possible to set the Switch Size? or add a text on the switch like "ON"/"OFF", "I/O"
 
Upvote 0
Top