Forum Xamarin.Android

How to change the font of a view outside of the current content view?

BrianSunburyBrianSunbury USMember ✭✭
edited June 2017 in Xamarin.Android

I'm using data binding and have a grid:
<Mvx.MvxGridView
android:id="@+id/mainMenuGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="5dp"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="5dp"
android:horizontalSpacing="5dp"
android:stretchMode="columnWidth"
android:gravity="center"
local:MvxBind="ItemsSource MenuList"
local:MvxItemTemplate="@layout/itemview"
android:background="#000000" />

my itemview looks like this:
<?xml version="1.0" encoding="utf-8"?>



I want to change the font of the TextView in my itemview so I can use FontAwesome. I tried something like
var changeTogButt = FindViewById(Resource.Id.toggleListGridButton);
Typeface typeface = Typeface.CreateFromAsset(Assets, "Fonts/FontAwesome.ttf");
changeTogButt.SetTypeface(typeface, TypefaceStyle.Normal); but the itemview is not in the current view so changeTogButt returns null;

Is there a way to place the itemview in the same file as the Gridview? Or a way to find the view?

Sign In or Register to comment.