Domanda

I just update my montouch to xamarin.iOS 7.0.2. before that I have this code in my project:

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

but it is not working now.

I face with this error:

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

Now, how should I use this?

È stato utile?

Soluzione

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

Altri suggerimenti

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

This tutorial link for customized Text kit property.Check this may be it help full.

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

In iOS 7 into syntax are changed.It's something like that HTML property.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top