ProMotion icon indicating copy to clipboard operation
ProMotion copied to clipboard

TableScreen's title_view doesn't work with rmq/redpotion

Open markrickert opened this issue 9 years ago • 1 comments

I ran into an issue where when setting a title_view: on a table section would actually set the RMQ stylesheet I had set on the screen to nil, causing all sorts of problems for the cells underneath.

I fixed this in my project by doing this in table.rb.

# Section header view methods
def tableView(_, viewForHeaderInSection: index)
  section = promotion_table_data.section(index)
  view = section[:title_view]
  view = section[:title_view].new if section[:title_view].respond_to?(:new)

  # Added the line below to fix the issue...
  view.stylesheet = self.stylesheet if self.stylesheet && view.respond_to?(:stylesheet=)

  view.on_load if view.respond_to?(:on_load)
  view.title = section[:title] if view.respond_to?(:title=)
  view
end

Not sure if we should add this to redpotion or what...

markrickert avatar Jan 19 '16 21:01 markrickert

Odd. Yeah, we should probably add this to RedPotion.

jamonholmgren avatar Jan 20 '16 16:01 jamonholmgren