Husein Behboudi Rad
Husein Behboudi Rad

Reputation: 5462

UIFont in monotouch iOS 7.0.2

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?

Upvotes: 3

Views: 481

Answers (2)

Oliver Weichhold
Oliver Weichhold

Reputation: 10296

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

Upvotes: 3

Renish Dadhaniya
Renish Dadhaniya

Reputation: 10752

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.

Upvotes: 0

Related Questions