omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Switch in ui module unresponsive

    Pythonista
    ui.switch
    3
    5
    3371
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • disorientedp
      disorientedp last edited by

      Pythonista 2.0

      I am new to the ui module. I've been messing around with it and I've figured out basically how to create user interfaces, but I can't, for some reason, figure out how to use switches. I have a switch in a ui view with an associated function. The problem is that when I tap the switch, nothing happens. The switch doesn't change positions. Why is this happening?

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        Does this switch work? import ui ; ui.Switch().present('sheet')

        1 Reply Last reply Reply Quote 0
        • disorientedp
          disorientedp last edited by

          @ccc said:

          import ui ; ui.Switch().present('sheet')

          Yes.

          1 Reply Last reply Reply Quote 0
          • disorientedp
            disorientedp last edited by

            That's weird. I re-added it and deleted it several times, and it worked on the fourth attempt. I don't know what I did.

            Phuket2 1 Reply Last reply Reply Quote 0
            • Phuket2
              Phuket2 @disorientedp last edited by

              @disorientedp , the only thing I can think of , is if somehow the switch was obscured by another view, hence not receiving the touch event. Or you added it to another control as a sub view such as a label. Label, by default does not handle touch events, but you can change that in code

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors