Merge pull request #215 from infinitered/table_view_background_image

Tableviews need a different `st.background_image`
This commit is contained in:
Mark Rickert
2015-03-14 16:09:22 -04:00
2 changed files with 23 additions and 0 deletions

View File

@@ -22,6 +22,17 @@ module RubyMotionQuery
@view.rowHeight = value
end
def background_image=(value)
@view.backgroundView = UIImageView.alloc.initWithImage(value)
end
def background_image
if @view.backgroundView
@view.backgroundView.image
else
nil
end
end
SEPARATOR_STYLES = {
none: UITableViewCellSeparatorStyleNone,
single: UITableViewCellSeparatorStyleSingleLine,

View File

@@ -36,4 +36,16 @@ describe 'stylers/ui_table_view' do
v.rowHeight.should == 20
end
end
it 'should allow getting and setting the background image' do
view = @vc.rmq.append(@view_klass, :ui_table_view_kitchen_sink)
view.style do |st|
st.background_image.should == nil
background = rmq.image.resource("Default")
st.background_image = background
st.background_image.should == background
end
end
end