9

What's the equivalent of sizeWithFont in MonoTouch. If there's no such method, is it possible to invoke it some other way?

All I want to do is resize the label based on the text...

Jonas Stawski
  • 6,682
  • 6
  • 61
  • 106

3 Answers3

18

The next update (MonoTouch 1.1) will have the methods available as UIView.StringSize (string str, UIFont font)

miguel.de.icaza
  • 32,654
  • 6
  • 58
  • 76
1

To answer my own question... Use selectors to pimboke the objective-c methods:

http://monotouch.net/index.php?title=Documentation/Objective-C_Selectors

Jonas Stawski
  • 6,682
  • 6
  • 61
  • 106
0

The NSString StringSize method would work for a single line label.

Demmostenes
  • 101
  • 1
  • 5