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.
Custom views in ui builder?
-
Has anyone gotten a custom view which is not the main view to work in the ui builder? I'm running 1.5 on ios 7.
There is a custom view widget, which lets you insert a custom view class... I've made sure to define the class before calling load_view, but the custom view object is never instantiated, instead only a vanilla
_ui.View
.If I set a custom view for the main view, and load_view, it does produce an object of the custom class... Just not for widgets added using the Custom View button.
-
Check out my chordcalc script. The fretboard is a custom view. I create in in the builder.
-
Ok, it appears that the custom class cannot be in another module.
For instance, if try to specify myModule.someclass in ui builder, and have the following code
import myModule import ui ui.load_view('myView')
I get
Warning: Custom class 'myModule.someclass' could not be found.
But, if I import someclass directly, and just specify
someclass
In the builderfrom myModule import someclass import ui
works ok.