how do i create a custom cursor adapter for a listview for use with images and text?

后端 未结 4 499
孤街浪徒
孤街浪徒 2020-12-05 01:14

Hi want to create a custom cursor adapter so I can display an image with 2 lines of text. I have had some trouble understanding the custom cursor adapters but I do not under

4条回答
  •  攒了一身酷
    2020-12-05 01:53

    Adding images and text is not specific to CursorAdapter; you use the same technique for any kind of adapter. You can create a layout for your row and inflate it inside your getView method. The APIDemos sample project, contained in the Android SDK android-sdk-PLATFORM/samples/android-XY/ApiDemos folder, does what you want. You can find the row definitons in list_item_icon_text.xml. Here is copy of file content (w/o the license).

    
    
    
        
    
        
    
    
    

提交回复
热议问题