I have ListView where every item represented as image + text, defined in separate layout. When user clicks any item, I would like to extend selected item with additional information, so listview would have bigger height and contain some text. What is the best practice to do that? Should I replace listview item view somehow?
1 Answer
You can use Visibility property by setting it to Invisible, and then change it to Visible when Item is Clicked. note that the information height should be auto and you need to calculate ListView Height with each modification;
Edited Code:
FindViewById<TextView>(Resource.Id.Test).Visibility = Android.Views.ViewStates.Invisible;
Use this code to set the element (ex. TextView) to Invisible or Visible (ViewStates.Visible)
2 Comments
Vladimir
A. Salim, should I bind isVisible somehow to listitem? Do you have any example or link to example for similar functionality?
A. Salim
Sorry Vladimir, I confused with xamarin.forms, it's not IsVisible but actually Visibility Property that you can set to Invisible in your code, I will update my comment: