bmichotte / ProMotion-XLForm

ProMotion-XLForm is a ProMotion plugin for XLForm
MIT License
20 stars 21 forks source link

Styling the form with rmq #49

Closed uksa closed 8 years ago

uksa commented 8 years ago

I've attempted to style the form using req, however I can't seem to figure out how to do it.

class MyScreen < PM::XLFormScreen

  def on_load
    rmq.stylesheet = MyStylesheet
  end

StyleSheet

  def form_view(st)
    st.background_color = UIColor.greenColor
  end

However no styling is applied, looking at the code, I need to get if self.class.respond_to?(:rmq_style_sheet_class) && self.class.rmq_style_sheet_class to be true, however I can't figure out how to achieve this. Please help :)

bmichotte commented 8 years ago

what about

class MyScreen < PM::XLFormScreen
  stylesheet MyStylesheet
end
uksa commented 8 years ago

undefined method `stylesheet'

Do I need to include some reference to req stylesheet, I tried include RubyMotionQuery however it made no difference and I still got an undefined method.

grimmwerks commented 8 years ago

uksa - are you using redpotion?

grimmwerks commented 8 years ago

Just to let you know -- I'm using redpotion; I've got a form_data PM::XLFormScreen and using stylesheet MyClass as referenced above, and

  def form_view(st)
    st.background_color = color.green
  end

worked exactly as it should. If you are using redpotion try calling 'rake newclear' and see if that cleans everything up?

uksa commented 8 years ago

Yep that was the issue, I'm using ruby_motion_query gem instead of redpotion, it works now. Thanks for the support.