Merge pull request #167 from squidpunch/add-separator-inset

Adds styler for separatorInset and rowHeight for table
This commit is contained in:
Gant Laborde
2015-01-20 12:54:47 -06:00
2 changed files with 13 additions and 1 deletions

View File

@@ -14,6 +14,14 @@ module RubyMotionQuery
def allows_selection=(value) ; @view.allowsSelection = value ; end
def allows_selection ; @view.allowsSelection ; end
def separator_inset=(value)
@view.separatorInset = value
end
def row_height=(value)
@view.rowHeight = value
end
SEPARATOR_STYLES = {
none: UITableViewCellSeparatorStyleNone,
single: UITableViewCellSeparatorStyleSingleLine,
@@ -21,6 +29,5 @@ module RubyMotionQuery
}
end
end
end

View File

@@ -7,8 +7,11 @@ class SyleSheetForUIViewStylerTests < RubyMotionQuery::Stylesheet
st.separator_color = st.separator_color
st.separator_color = UIColor.redColor
st.separator_inset = [0, 46, 0, 0]
st.allows_selection = st.allows_selection
st.allows_selection = false
st.row_height = 20
end
end
@@ -29,6 +32,8 @@ describe 'stylers/ui_table_view' do
v.separatorStyle.should == UITableViewCellSeparatorStyleNone
v.separatorColor.should == UIColor.redColor
v.allowsSelection.should == false
v.separatorInset.should == UIEdgeInsetsMake(0, 46, 0, 0)
v.rowHeight.should == 20
end
end
end