Class: RMXAutoLayoutLabel

Inherits:
UILabel
  • Object
show all
Defined in:
lib/motion/RMXAutoLayoutLabel.rb

Instance Method Summary collapse

Instance Method Details

#intrinsicContentSizeObject



11
12
13
14
15
16
17
18
# File 'lib/motion/RMXAutoLayoutLabel.rb', line 11

def intrinsicContentSize
  s = super
  if numberOfLines == 0
    # found out that sometimes intrinsicContentSize is 1pt too short!
    s.height += 1
  end
  s
end

#layoutSubviewsObject



2
3
4
5
6
7
8
9
10
# File 'lib/motion/RMXAutoLayoutLabel.rb', line 2

def layoutSubviews
  super
  if numberOfLines == 0
    if preferredMaxLayoutWidth != frame.size.width
      self.preferredMaxLayoutWidth = frame.size.width
      setNeedsUpdateConstraints
    end
  end
end