android - Not able to set font to setAdapter -
is possible set myfont string[], doing want set font r.id.txt values pass hashmap through string[]
class="snippet-code-js lang-js prettyprint-override">optionsmenulist.setadapter(new simpleadapter(getapplicationcontext(), array, r.layout.custom_list_row, new string[] { "name", "image" }, new int[] { r.id.txt, r.id.music })); ((textview) findviewbyid(r.id.txt)).settypeface(title);
create object textview
textview tv; typeface typeface = utils.gettypeface(activity, <get font here)>); // fontstyle assets if added tv=(textview) findviewbyid(r.id.txt); tv.settypeface(typeface); public static typeface gettypeface(context context, string type) { if (textutils.isempty(type)) { homecoming typeface.createfromasset(context.getassets(), fonts/segoerg.ttf); }
android string fonts
No comments:
Post a Comment