droidlabs / motion-prime

RubyMotion apps development framework
46 stars 5 forks source link

How to get MPLabel elements from a UIView? #31

Open cactis opened 9 years ago

cactis commented 9 years ago

"view.subviews" not always return mplabels elements. thanks

gvalmon commented 9 years ago

When you create "draw" label element (it's by default) - it actually does not create uiview and it will not be accessible via view.subviews. if you want it to be created as uiview, please set element type "view":

element :my_label, as: :view

However, that way the speed of rendering will be reduced. Instead, you can access to list of MPLabel elements (not views) via section.elements.