Merge pull request #58 from markrickert/version-0.6-cell-heights

Allow the user to specify individual cell height in the cell hash.
This commit is contained in:
Jamon Holmgren
2013-05-07 19:50:06 -07:00
2 changed files with 10 additions and 0 deletions

View File

@@ -747,6 +747,7 @@ def table_data
subtitle: "This is way too huge..see note",
arguments: { data: [ "lots", "of", "data" ] },
action: :tapped_cell_1,
height: 50, # manually changes the cell's height
cell_style: UITableViewCellStyleSubtitle,
cell_identifier: "Cell",
cell_class: ProMotion::TableViewCell,

View File

@@ -261,6 +261,15 @@ module ProMotion::MotionTable
return table_cell
end
def tableView(tableView, heightForRowAtIndexPath:indexPath)
cell = cell_at_section_and_index(indexPath.section, indexPath.row)
if cell[:height]
cell[:height].to_f
else
tableView.rowHeight
end
end
def tableView(table_view, didSelectRowAtIndexPath:indexPath)
cell = cell_at_section_and_index(indexPath.section, indexPath.row)
table_view.deselectRowAtIndexPath(indexPath, animated: true);