mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 22:51:53 +08:00
38 lines
969 B
Ruby
38 lines
969 B
Ruby
class <%= @name_camel_case %>Controller < UIViewController
|
|
|
|
def viewDidLoad
|
|
super
|
|
|
|
rmq.stylesheet = <%= @name_camel_case %>ControllerStylesheet
|
|
rmq(self.view).apply_style :root_view
|
|
|
|
# Create your views here
|
|
end
|
|
|
|
# Remove if you are only supporting portrait
|
|
def supportedInterfaceOrientations
|
|
UIInterfaceOrientationMaskAll
|
|
end
|
|
|
|
# Remove if you are only supporting portrait
|
|
def willAnimateRotationToInterfaceOrientation(orientation, duration: duration)
|
|
rmq.all.reapply_styles
|
|
end
|
|
end
|
|
|
|
|
|
__END__
|
|
|
|
# You don't have to reapply styles to all UIViews, if you want to optimize,
|
|
# another way to do it is tag the views you need to restyle in your stylesheet,
|
|
# then only reapply the tagged views, like so:
|
|
def logo(st)
|
|
st.frame = {t: 10, w: 200, h: 96}
|
|
st.centered = :horizontal
|
|
st.image = image.resource('logo')
|
|
st.tag(:reapply_style)
|
|
end
|
|
|
|
# Then in willAnimateRotationToInterfaceOrientation
|
|
rmq(:reapply_style).reapply_styles
|