mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
Fixes deprecations and crash in demo app.
This commit is contained in:
@@ -73,7 +73,7 @@ class MainController < UIViewController
|
||||
# You really should create a new style in the stylesheet,
|
||||
# but you can do it inline too, like so
|
||||
rmq.style do |sv|
|
||||
sv.top = rand(rmq.device.height)
|
||||
sv.frame = {top: rand(rmq.device.height)}
|
||||
sv.scale = 10.0
|
||||
end
|
||||
},
|
||||
@@ -81,7 +81,7 @@ class MainController < UIViewController
|
||||
rmq.animate( duration: 0.2, animations: -> (rmq) {
|
||||
rmq.style do |sv|
|
||||
sv.scale = 1.0
|
||||
sv.top = 230
|
||||
sv.frame = {top: 230}
|
||||
end
|
||||
})
|
||||
})
|
||||
|
||||
@@ -168,15 +168,13 @@ class MainControllerStylesheet < ApplicationStylesheet
|
||||
def popup_wrapper(st)
|
||||
st.hidden = true
|
||||
|
||||
st.frame = {w: screen_width - 20, h: 120}
|
||||
st.centered = :both
|
||||
st.frame = {w: screen_width - 20, h: 120, centered: :both}
|
||||
st.background_color = color.white
|
||||
st.z_position = 100
|
||||
end
|
||||
|
||||
def popup_text_label(st)
|
||||
label st
|
||||
st.padded = {l: 10, t: 10, b:10, r: 10}
|
||||
st.text_alignment = :left
|
||||
st.color = color.black
|
||||
st.font = font.system(10)
|
||||
|
||||
@@ -68,8 +68,7 @@ __END__
|
||||
# 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.frame = {t: 10, w: 200, h: 96, centered: :horizontal}
|
||||
st.image = image.resource('logo')
|
||||
st.tag(:reapply_style)
|
||||
end
|
||||
|
||||
@@ -27,8 +27,7 @@ __END__
|
||||
# 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.frame = {t: 10, w: 200, h: 96, centered: :horizontal}
|
||||
st.image = image.resource('logo')
|
||||
st.tag(:reapply_style)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user