Module: Tgios::ExtendedUITableView

Includes:
PlasticCup
Included in:
SearchController
Defined in:
lib/tgios/extended_ui_table_view.rb

Instance Method Summary collapse

Instance Method Details

#add_full_table_view_to(view, style = :grouped) ⇒ Object



5
6
7
8
9
10
# File 'lib/tgios/extended_ui_table_view.rb', line 5

def add_full_table_view_to(view, style=:grouped)
  style ||= :plain
  table = UITableView.send(style)
  CommonUIUtility.add_full_subview(view, table)
  table
end

#add_title_to_table_header(title, table) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/tgios/extended_ui_table_view.rb', line 12

def add_title_to_table_header(title, table)
  frame = table.bounds
  frame.size.height = 45
  table_header = UIView.alloc.initWithFrame(frame)
  table.tableHeaderView = table_header
  add_title_to_view(title, table_header)

end

#add_title_to_view(title, view) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/tgios/extended_ui_table_view.rb', line 21

def add_title_to_view(title, view)

  Motion::Layout.new do |l|
    l.view view
    l.subviews 'label' => Base.style(UILabel.new, text: title,
                                     font: UIFont.boldSystemFontOfSize(19),
                                     adjustsFontSizeToFitWidth: true)
    l.vertical '|-10-[label]|'
    l.horizontal '|-10-[label]-10-|'
  end
end