Class: SectionHeaderView

Inherits:
UIView
  • Object
show all
Defined in:
lib/project/views/section_header_view.rb

Instance Method Summary collapse

Instance Method Details

#initWithFrame(frame) ⇒ Object



5
6
7
8
9
# File 'lib/project/views/section_header_view.rb', line 5

def initWithFrame(frame)
  super.tap do |view|
    view.addSubview(section_title)
  end
end

#section_titleObject



15
16
17
18
19
20
21
22
23
# File 'lib/project/views/section_header_view.rb', line 15

def section_title
  @section_title ||= PaddedLabel.alloc.initWithFrame(bounds).tap do |label|
    label.adjustsFontSizeToFitWidth = true
    label.backgroundColor           = MotionForm.section_header_color
    label.font                      = MotionForm.section_header_font
    label.padding                   = 10
    label.textColor                 = MotionForm.section_header_text_color
  end
end

#text=(text) ⇒ Object



11
12
13
# File 'lib/project/views/section_header_view.rb', line 11

def text=(text)
  section_title.text = text
end