views:

27

answers:

1
  1. I have two labels side by side in the ipad with each taking half the screen.
  2. I dont want to use the scrollview.
  3. I just want the left label to contain the exact amount of test it can and want the remaining to go to the right label.

How can I get the length of the string that a fixed size UILabel can contain?

+1  A: 

NSString has a method that can return the size (in pixels) for a string with a given font. You could use this to successively trim off characters until it fits. NSString sizeWithFont:minFontSize:actualFontSize:forWidth:lineBreakMode:

PfhorSlayer