When we display the images in a Gallery view in Android, is their any way to set a title or set image name for the gallery items?
Technically I would like to name each and every gallery item. Is this possible?
Thanks,
Sana.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s possible, with two solutions.
You can has these components for titles (Such a TextView) and update its value in the setOnItemSelectedListener.onItemSelected method, that was called when you are flinging your itens around with the new object that will be in the center.
In this case: lets say you have an LinearLayout with an TextView with id: “title” and below it an Gallery with id: “itens”.
You should have a method like this:
OR
You can write your own adapter and inflate a layout witch you can set the title there.