Hello it's me again!
I am playing around with implementing a UIStackView via objc_util
I have two questions:
- How do I get access to the Enumerations?
Such as "UILayoutConstraintAxisVertical" or "UIStackView.Distribution.fill"?
I've used the load_framework helper to load UIKit, and QuartzCore and no luck.
--
- I know I can't use ui.View.add_subview() when using a custom UIView class (such as UIStackView); but I can access ui.View().objc_instance.addSubview() and it seems to work.
My code is too messy to post, but I will later if I can't get it going with this.
I am setting up a subclass of ui.View(), from there I've setup UIStackView as self.stackview.
The UIStackView uses its subviews to render the content.
Is there anything i can do to allow me to use the ui.View().add_subview()?
2.5:
Also, if anyone can give me a thought on how I am planning on implementing this..
class StackView (ui.View):
def __init__(self):
self.stackview = UIStackView.alloc().init()
# Setup stackview options..
# Setup properties for common used SV opt's
@on_main_thread
def add_subview(self, subview, use_stackview=True):
# TODO: Add Error checking
if use_stackview:
self.stackview.addSubview(subview)
else:
self.add_subview(subview)
This is a quick rough idea of how I see it working, so it "feels" like it was embedded in Pythonista.
Any help on above items would be grand!