如何更改ListView项目的字体?

我有问题,我想为我的列表视图创建一个自定义设计,但我不知道该怎么做。 我使用的是我的列表视图中的sql数据库。 哈哈对不起我不知道怎么说这个…因为我是德国人…所以顺便说一句抱歉我的englsih。 这是我的代码:

private void populateListViewFromDB() { Cursor cursor = myDb.getAllRows(); startManagingCursor(cursor); String[] fromFieldNames = new String[] {DBAdapter.KEY_NAME, DBAdapter.KEY_STUDENTNUM, DBAdapter.KEY_FAVCOLOUR, DBAdapter.KEY_STUDENTNUM}; int[] toViewIDs = new int[] {R.id.item_name, R.id.item_icon, R.id.item_favcolour, R.id.item_studentnum}; SimpleCursorAdapter myCursorAdapter = new SimpleCursorAdapter( this, R.layout.item_layout, cursor, fromFieldNames, toViewIDs ); // Set the adapter for the list view ListView myList = (ListView) findViewById(R.id.listViewFromDB); myList.setAdapter(myCursorAdapter); } 

谢谢你的帮忙!:)

试试这种方式,希望这可以帮助您解决问题。

以下是该问题的详细说明。

http://javatechig.com/android/using-external-fonts-in-android-view

基本上对你来说,因为它在列表视图中我建议你创建自定义textview。 将字体文件放在assets文件夹中非常重要。