Thursday 15 July 2010

android - How to set the custom font to dynamically created listView? -


I'm a newbie for Android Do I have to set custom font in list view?

How to set the font? My code: Public class Main activity list activity {string [] presidents = "Dwight D. Eisenhower", "John F. Kennedy", "Lyndon B. Johnson", "Richard Nixon", " "George W. Bush", "Barack Obama"}; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); // --- No need to call this - // Set Content power (R. Layout .Main); SetListAdapter (new array adapter & lt; string & gt; (this, android.R.layout.simple_list_item_1, President)); }

}

You must create a custom adapter, and Set the font of the items in the adapter. See it for an example:

No comments:

Post a Comment