Skip to content

Instantly share code, notes, and snippets.

@dehghani-mehdi
Last active December 28, 2017 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dehghani-mehdi/f6f94b1ea493a1cb1cbc67810f6eb376 to your computer and use it in GitHub Desktop.
Save dehghani-mehdi/f6f94b1ea493a1cb1cbc67810f6eb376 to your computer and use it in GitHub Desktop.
[Xamarin.Android] Using custom font
// First you need to put .ttf of the font to Assets folder
// Let's say the font file name is: MyFont.ttf
// create typeface
var typeface = Typeface.CreateFromAsset(Assets, "MyFont.ttf");
// find the TextView
var tvTitle = FindViewById<TextView>(Resource.Id.tvTitle);
// assign the typeface to the TextView
tvTitle.SetTypeface(typeface, TypefaceStyle.Normal);
// Find more xamarin gists: https://github.com/dehghani-mehdi/best-xamarin-gists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment