2013-10-31 36 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屬性。