sizeWithFont with MonoTouch

2019-04-22 02:00发布

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...

标签: xamarin.ios
3条回答
爷、活的狠高调
2楼-- · 2019-04-22 02:32

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

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

查看更多
仙女界的扛把子
3楼-- · 2019-04-22 02:46

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

查看更多
小情绪 Triste *
4楼-- · 2019-04-22 02:49

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

查看更多
登录 后发表回答