我使用MonoTouch.Dialog(高度定制),并使用tableView的StringSize方法来获取字符串的大小(高度和宽度)。这在 iOS 7 中现在不起作用。如何返回字符串的 Size 来获取它的高度/宽度,以便我可以执行相邻的控件对齐?
谢谢。
最佳答案
var tv = new UITextView() {
Text = "Some text",
Font = UIFont.PreferredBody
};
//Pass in a maximum size (in this case, vastly larger than needed)
var neededSize = tv.SizeThatFits(new SizeF(1000, 1000));
Console.WriteLine(neededSize);
关于c# - 在 iOS 7 中获取字符串的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19079023/