Class: RubyMotionQuery::Stylers::UILabelStyler

Inherits:
UIViewStyler show all
Defined in:
motion/ruby_motion_query/stylers/ui_label_styler.rb

Constant Summary

TEXT_ALIGNMENTS =
{
  left: NSTextAlignmentLeft,
  center: NSTextAlignmentCenter,
  right: NSTextAlignmentRight,
  justified: NSTextAlignmentJustified,
  natural: NSTextAlignmentNatural
}

Instance Method Summary (collapse)

Methods inherited from UIViewStyler

#background_color, #background_color=, #background_image=, #bottom, #bottom=, #center, #center=, #center_x, #center_x=, #center_y, #center_y=, #centered=, #clips_to_bounds, #clips_to_bounds=, #content_mode, #content_mode=, #enabled, #enabled=, #frame, #frame=, #from_bottom, #from_bottom=, #from_right, #from_right=, #height, #height=, #hidden, #hidden=, #initialize, #left, #left=, #opaque, #opaque=, #padded=, #right, #right=, #rotation=, #scale=, #super_height, #super_width, #superview, #tag, #top, #top=, #view, #view=, #view_has_been_styled?, #width, #width=, #z_position, #z_position=

Constructor Details

This class inherits a constructor from RubyMotionQuery::Stylers::UIViewStyler

Instance Method Details

- (Object) color



12
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 12

def color ; @view.textColor ; end

- (Object) color=(value)



11
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 11

def color=(value) ; @view.setTextColor value ; end

- (Object) font



9
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 9

def font ; @view.font ; end

- (Object) font=(value)



8
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 8

def font=(value) ; @view.setFont value ; end

- (Object) number_of_lines



18
19
20
21
22
23
24
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 18

def number_of_lines
  if @view.numberOfLines == 0
    :unlimited
  else
    @view.numberOfLines
  end
end

- (Object) number_of_lines=(value)



14
15
16
17
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 14

def number_of_lines=(value)
  value = 0 if value == :unlimited
  @view.setNumberOfLines(value)
end

- (Object) resize_to_fit_text Also known as: size_to_fit



33
34
35
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 33

def resize_to_fit_text
  @view.sizeToFit
end

- (Object) text



6
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 6

def text ; @view.text ; end

- (Object) text=(value)



5
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 5

def text=(value) ; @view.setText value ; end

- (Object) text_alignment



29
30
31
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 29

def text_alignment
  @view.textAlignment
end

- (Object) text_alignment=(value)



26
27
28
# File 'motion/ruby_motion_query/stylers/ui_label_styler.rb', line 26

def text_alignment=(value)
  @view.setTextAlignment(TEXT_ALIGNMENTS[value] || value)
end