Caching images and displaying

后端 未结 5 960
臣服心动
臣服心动 2020-11-22 15:37

Hello Am facing a particular problem in which I need to download images and display them onto a ListView corresponding to their particular TextView\'s

5条回答
  •  暖寄归人
    2020-11-22 16:15

    I dont know about storing the images, as my app uses images from the APK. However I believe for displaying those images you want a custom Arrayadapter.

    This inflates a layout for each item and places it in a list. This layout is defined by and XML layout you create and specify in its construction. You should try extending whatever adapter you currently use for your list view with a custom one that sets the image view according to the item.

    I do this with ImageView.setImageResource(resource ID); But your mileage may vary. I have my images in the APK not sure how to display them from an external source

提交回复
热议问题