mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 09:33:43 +08:00
Merge pull request #222 from infinitered/user_interaction_enabled
Allows you to set a UIView's userInteractionEnabled property.
This commit is contained in:
@@ -392,6 +392,12 @@ module RubyMotionQuery
|
||||
end
|
||||
def shadow_path ; @view.layer.shadowPath ; end
|
||||
|
||||
def user_interaction_enabled=(value)
|
||||
@view.setUserInteractionEnabled(!!value)
|
||||
end
|
||||
def user_interaction_enabled
|
||||
@view.isUserInteractionEnabled
|
||||
end
|
||||
|
||||
# @deprecated - use frame hashs
|
||||
def left=(value)
|
||||
|
||||
@@ -50,6 +50,7 @@ class StyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
|
||||
st.background_color = color.red
|
||||
st.tint_color = color.blue
|
||||
st.corner_radius = 5
|
||||
st.user_interaction_enabled = false
|
||||
|
||||
# Shadows
|
||||
st.shadow_color = color.gray
|
||||
@@ -336,6 +337,18 @@ describe 'ui_view_styler' do
|
||||
@value.should.be.false
|
||||
end
|
||||
|
||||
it "should set user interaction enabled and disabled" do
|
||||
view = @vc.rmq.append(@view_klass, :ui_view_kitchen_sink).get
|
||||
|
||||
view.isUserInteractionEnabled.should == false
|
||||
|
||||
rmq(view).style do |st|
|
||||
st.user_interaction_enabled.should == false
|
||||
st.user_interaction_enabled = true
|
||||
st.user_interaction_enabled.should == true
|
||||
end
|
||||
end
|
||||
|
||||
it "should set shadow values" do
|
||||
view = @vc.rmq.append(@view_klass, :ui_view_kitchen_sink).get
|
||||
|
||||
|
||||
Reference in New Issue
Block a user