Last active
June 15, 2016 05:50
[Xamarin] ¿Cómo usar Segoe MDL2 Assets en Xamarin.Android? - http://epicalsoft.blogspot.pe/2016/06/xamarin-como-usar-segoe-mdl2-assets-en.html . #Xamarin #VisualStudioAndDevelopmentTechnologies Autor: M. Alexander Salazar (http://bit.ly/1urSn7l)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using Android.Runtime; | |
using Android.Util; | |
using Android.Widget; | |
using System; | |
namespace Blog.Epicalsoft.Com.Droid.Views | |
{ | |
public class IconTextView : TextView | |
{ | |
public IconTextView(Context context) : base(context) | |
{ | |
Typeface = SegoeMDL2Typeface.Instance; | |
Gravity = Android.Views.GravityFlags.CenterVertical; | |
} | |
public IconTextView(Context context, IAttributeSet attrs) : base(context, attrs) | |
{ | |
Typeface = SegoeMDL2Typeface.Instance; | |
Gravity = Android.Views.GravityFlags.CenterVertical; | |
} | |
public IconTextView(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) | |
{ | |
Typeface = SegoeMDL2Typeface.Instance; | |
Gravity = Android.Views.GravityFlags.CenterVertical; | |
} | |
protected IconTextView(IntPtr javaReference, JniHandleOwnership transfer) : base(javaReference, transfer) | |
{ | |
Typeface = SegoeMDL2Typeface.Instance; | |
Gravity = Android.Views.GravityFlags.CenterVertical; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<blog.epicalsoft.com.droid.views.IconTextView | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:text="\uE001 " /> | |
</LinearLayout> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.Graphics; | |
namespace Blog.Epicalsoft.Com.Droid | |
{ | |
public class SegoeMDL2Typeface | |
{ | |
public static Typeface Instance = Typeface.CreateFromAsset(Application.Context.Assets, "segmdl2.ttf"); | |
private SegoeMDL2Typeface() | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment