Class: BasicTableViewCellWithTitle

Inherits:
BasicTableViewCell show all
Defined in:
lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb

Constant Summary

Constants included from ControlVariables

ControlVariables::CELL_BACKGROUND_COLOR, ControlVariables::CELL_HEIGHT, ControlVariables::CELL_WIDTH, ControlVariables::HORIZONTAL_VIEW_SELECTED_BACKGROUND_COLOR

Instance Attribute Summary collapse

Attributes inherited from BasicTableViewCell

#thumbnail

Instance Method Summary collapse

Methods inherited from BasicTableViewCell

#initWithFrame, #set_thumbnail_image, #set_thumbnail_image_with_url

Instance Attribute Details

#title_labelObject

Returns the value of attribute title_label.



2
3
4
# File 'lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb', line 2

def title_label
  @title_label
end

Instance Method Details

#after_frame_initializationObject



4
5
6
# File 'lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb', line 4

def after_frame_initialization
  setup_title_label
end

#reset_title_label_frameObject



26
27
28
29
30
31
# File 'lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb', line 26

def reset_title_label_frame
  self.title_label.sizeToFit
  frame = self.title_label.frame
  frame.size.width = 85
  self.title_label.frame = frame
end

#set_title_label_text(text) ⇒ Object



21
22
23
24
# File 'lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb', line 21

def set_title_label_text text
  self.title_label.text = text
  reset_title_label_frame
end

#setup_title_labelObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/motion-horizontal-scroll/basic_table_view_cell_with_title.rb', line 8

def setup_title_label
  label_frame = CGRectMake(15, CELL_HEIGHT - 55, 85, 50)
  self.title_label = UILabel.alloc.initWithFrame(label_frame)
  self.title_label.text = ""
  self.title_label.font = UIFont.boldSystemFontOfSize(12)
  self.title_label.numberOfLines = 2
  self.title_label.backgroundColor = UIColor.clearColor
  self.title_label.baselineAdjustment = UIBaselineAdjustmentAlignBaselines
  self.title_label.textAlignment = NSTextAlignmentCenter
  self.title_label.textColor = "#3d4040".to_color
  self.thumbnail.addSubview(self.title_label)
end