Allow setting a view transform manually in UIView styler.

This commit is contained in:
Mark Rickert
2014-12-31 17:34:31 -05:00
parent adcc99aa2e
commit 1cf12d2bd0
2 changed files with 16 additions and 0 deletions

View File

@@ -225,6 +225,13 @@ module RubyMotionQuery
@view.transform = CGAffineTransformMakeRotation(radians)
end
def transform=(transformation)
@view.transform = transformation
end
def transform
@view.transform
end
def content_mode=(value)
@view.setContentMode value
end

View File

@@ -303,6 +303,15 @@ describe 'ui_view_styler' do
view.transform.should == CGAffineTransformMakeRotation(radians)
end
it "should set a manual transformation" do
transform = CGAffineTransformMakeScale(-1, -1)
view = @vc.rmq.append(@view_klass).style do |st|
st.transform = transform
end.get
view.transform.should == transform
end
it "should return the correct value of enabled from the styler" do
view = UIView.alloc.init
view.setEnabled(false)