我有,我想创建一个自定义的设计,我的列表视图中的问题,但我不知道该怎么办。我使用的是SQL数据库,这是在我的列表视图。哈哈对不起,我dont't知道怎么说这个......因为IM german..so顺便说一句对不起我的ENGLSIH。这里是我的code:
I have the problem that i would like to create an custom design for my list view but I don't know how to do. I use a sql database which is in my list view. haha sorry I dont't know how to say this...because im german..so by the way sorry for my englsih. here is my code:
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);
}
感谢您的帮助!)
试试这个办法,希望这将帮助你解决你的问题。
下面是问题的详细说明。
Here is a detailed explanation of the issue.
http://javatechig.com/android/using-external-字体功能于Android的观点
基本上适合你,因为它是在ListView我建议你创建自定义的TextView。重要的是把你的字体文件中的资产的文件夹。
Basically for you, since it's in a listview I recommend that you create the custom textview. It's important to place you font files in the assets folder.