Search code examples
androidtextandroid-imageviewuniversal-image-loader

Show text on ImageView UIL


I am using Universal Image Loader. I want to set some Text on Image. How can I do this? ImageView does not let me set the text and I want to use UIL but it take only ImageView as a parameter.

displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener)

Thanks!


Solution

  • That should be easy. I don't know what UIL do exactly. But this should help you

    1. Create a custom view of your own.
    2. Use a relative layout as its root layout container element.
    3. Put Your Universal Image Loader Image first and TextView above to it
    4. Create your own delegate/methods in your custom view that will pass ImageView to UIL and text to TextView.
    5. Set visibility of element when images gets loaded. I hope UIL should have interfaces for
      that to notify client of image loading done state.

    That should do what you want to achieve.

    Hope it helps