Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Change the declared font size

$
0
0

Hi,
I'm sorry if this is a noob question but I'm just beginning with the xamarin.ios world.
I've declared my custom font in my appDelegate class inside the FinishedLaunching method just like this:

UILabel.Appearance.Font = UIFont.FromName("InventedFont", 12f);

Then in a different class I've declared my cell with its labels. This labels have the customFont I declared before. How could I do to declare a new size for the labels? I mean, I would like my lblTitle to have a fontSize of 18f for example. I tried with each one of the pieces of code below?

lblTitle.Font = UIFont.SystemFontOfSize(20f);
this.lblTitle.Font = this.lblTitle.Font.WithSize(20f);
this.lblTitle.Font = UIFont.FromName("InventedFont", 18f);

However a System.Reflection.TargetInvocationException pops up in this line:
UIApplication.Main(args, null, "AppDelegate");
What am I doing wrong? Could you help me please? Is there any way I could make it work? Thank you!


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>