-1

I'd like have default styles for UIViews.

Let's say that I want to have ALL UILabel with backgroundColor of color.light_gray.
Moreover I want to style my custom UIViews, e.g. for EVERY AttributedUILabel I want to have kerning value set to 2.

How to resolve that in RMQ?

Kamil Lelonek
  • 14,592
  • 14
  • 66
  • 90

1 Answers1

1

In your RMQ application, you should have an ApplicationStylesheet class from which all your other stylesheets should inherit.

You could add a default_label method in this ApplicationStylesheet:

def default_label(st)
  st.background_color = color.light_gray
end

To apply the style you would have to use it when you append your label

rmq.append UILabel, :default_label

Same goes for your AttributeUILabel, create a method in your ApplicationStylesheet and use the style when you append it to the view.

I suggest you go back to the RMQ stylesheets documentation, it shows everything you need to know about styling.

Marc Lainez
  • 3,070
  • 11
  • 16
  • I use this solution right now, but it's not perfect, because it forces me to remember about it each time I create `UILabel`. With TeaCup I have it out of the box, so I'm used to style some kind of `UIView` in one place and doesn't bother to remember anymore. – Kamil Lelonek Aug 11 '14 at 04:52