Class: ProMotion::TableViewCell
- Inherits:
-
UITableViewCell
- Object
- UITableViewCell
- ProMotion::TableViewCell
- Includes:
- TableViewCellModule
- Defined in:
- lib/ProMotion/cocoatouch/table_view_cell.rb
Instance Attribute Summary collapse
-
#image_size ⇒ Object
Returns the value of attribute image_size.
Attributes included from TableViewCellModule
Instance Method Summary collapse
-
#layoutSubviews ⇒ Object
TODO: Is this necessary?.
Methods included from TableViewCellModule
#set_accessory_view, #set_cell_attributes, #set_details, #set_image, #set_remote_image, #set_selection_style, #set_styles, #set_subtitle, #set_subviews, #setup
Methods included from Styling
#add, #add_to, #closest_parent, #content_height, #hex_color, #remove, #rgb_color, #rgba_color, #set_attribute, #set_attributes, #set_easy_attributes, #view_or_self
Methods included from Conversions
#camel_case, #convert_symbol, #objective_c_method_name
Instance Attribute Details
#image_size ⇒ Object
Returns the value of attribute image_size.
5 6 7 |
# File 'lib/ProMotion/cocoatouch/table_view_cell.rb', line 5 def image_size @image_size end |
Instance Method Details
#layoutSubviews ⇒ Object
TODO: Is this necessary?
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ProMotion/cocoatouch/table_view_cell.rb', line 8 def layoutSubviews super if self.image_size && self.imageView.image && self.imageView.image.size && self.imageView.image.size.width > 0 f = self.imageView.frame size_inset_x = (self.imageView.size.width - self.image_size) / 2 size_inset_y = (self.imageView.size.height - self.image_size) / 2 self.imageView.frame = CGRectInset(f, size_inset_x, size_inset_y) end end |