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.


    Accessing sub views

    Pythonista
    2
    3
    2721
    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.
    • donnieh
      donnieh last edited by

      I have a webview library object (named webview1) placed on the .pyui canvas. It's from the Pythonista gui editor library. I access this with the code below.

      How do I access this same webview object if it is placed as a subview in a scrollview named scrollview1?

      import ui

      view1 = ui.load_view()

      w1 = view1['webview1']

      w1.load_url('http://www.yahoo.com')

      view1.present()

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

        All subviews are accessed in the same way, no matter if it's a normal View, a ScrollView, or something else. In your case that would be view1['scrollview1']['webview1'].

        (I'm not sure why you'd want to place a WebView inside a ScrollView... the WebView is already scrollable on its own.)

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

          Thank you. Worked good. I appreciate the quick response.

          Yes your right, dgelessus. You normally wouldn't want a web view inside a scroll view. For my I app I am doing so. I want a few small web views running at once that can be scrolled. This is productivity web browsing app. Think of how You Tube has it's videos listed in a scroll view.

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