mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
Merge pull request #215 from infinitered/table_view_background_image
Tableviews need a different `st.background_image`
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user