Class: ProMotion::TableViewCell
- Inherits:
-
UITableViewCell
- Object
- UITableViewCell
- ProMotion::TableViewCell
- Defined in:
- lib/ProMotion/cocoatouch/TableViewCell.rb
Instance Attribute Summary collapse
-
#image_size ⇒ Object
Returns the value of attribute image_size.
Instance Method Summary collapse
Instance Attribute Details
#image_size ⇒ Object
Returns the value of attribute image_size.
3 4 5 |
# File 'lib/ProMotion/cocoatouch/TableViewCell.rb', line 3 def image_size @image_size end |
Instance Method Details
#layoutSubviews ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/ProMotion/cocoatouch/TableViewCell.rb', line 5 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 |