mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-06-04 19:45:35 +08:00
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:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user