2013-10-31 30 views
3

我只是更新我的montouch到xamarin.iOS 7.0.2。在此之前,我有这个代码在我的项目中:UIFont在monououch iOS 7.0.2

nameTextView .Font = new UIFont().WithSize (10); 

但它现在不工作。

我面对这个错误:

Error CS0619: `MonoTouch.UIKit.UIFont.UIFont()' is obsolete: `This constructor does not return a valid, default, instance' 

现在,我应该怎么用呢?

回答

3
nameTextView.Font = UIFont.FromName(UIFont.PreferredBody.Name, 10); 
0

http://www.raywenderlich.com/50151/text-kit-tutorial

本教程链接,自定义文本套件property.Check这可能是它帮助满。

self.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; self.textView.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];

在iOS 7语法改变。它就像那个HTML属性。