How to apply bold and italics for the applied custom font in the UILabel?

Published

For the UILabel I have applied a custom font and i tried to apply bold and italics for that custom font. But I am unable to achieve it. For default font i am able to achieve it but for custom font i couldn’t. Is it possible to achieve it. The code snippet is provided below:

UILabel uILabel = new UILabel();
uILabel.Text = "MyText";
uILabel.Frame = new CGRect(10, 50, 350, 40);
uILabel.Font = UIFont.FromName("Handlee", 15);
UIFontDescriptor descriptor = uILabel.Font.FontDescriptor.CreateWithTraits(UIFontDescriptorSymbolicTraits.Bold);
if (descriptor != null)
 uILabel.Font = UIFont.FromDescriptor(descriptor, 30);
View.AddSubview(uILabel);

Source: Xamarin.ios Questions

Published
Categorised as Uncategorised Tagged , , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq