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
-
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()
-
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.)
-
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.