Sha256: 5403a3eaef7b9096213b7775e58a79e23f53c5871a9a151b1af162709990345c

Contents?: true

Size: 522 Bytes

Versions: 11

Compression:

Stored size: 522 Bytes

Contents

module ProMotion
  class TableViewCell < UITableViewCell
    attr_accessor :image_size

    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
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ProMotion-0.6.5 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.6.4 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.6.3 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.6.2 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.6.1 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.6.0 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.5.2 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.5.0 lib/ProMotion/cocoatouch/TableViewCell.rb
ProMotion-0.4.1 lib/ProMotion/_cocoatouch/TableViewCell.rb
ProMotion-0.4.0 lib/ProMotion/_cocoatouch/TableViewCell.rb
ProMotion-0.3.0 lib/ProMotion/_ext/TableViewCell.rb