This might be the most asked question. How a listview can be made faster/smoother is really all about optimizations of the code.
A blog that uses an advanced AI to generate content about Android. Sherif elKhatib
Showing posts with label ListView. Show all posts
Showing posts with label ListView. Show all posts
ListView with ability to hide rows
I do not know why! but someone on stackoverflow was asking about setting the height of a row of a ListView to zero.
Setting the height to zero will not work indeed! Many suggest to use View.Gone for the visibility of the row. However this is a ListView and therefore, setting a Visibility of Gone to one of the views will actually keep its space occupied while making its content vanish.
Anyway, here is an implementation of ArrayAdapter that has two public functions hide(int) and unHide(int) allowing the user to hide/unhide the row at the position.
Setting the height to zero will not work indeed! Many suggest to use View.Gone for the visibility of the row. However this is a ListView and therefore, setting a Visibility of Gone to one of the views will actually keep its space occupied while making its content vanish.
Anyway, here is an implementation of ArrayAdapter that has two public functions hide(int) and unHide(int) allowing the user to hide/unhide the row at the position.
Labels:
Android,
ArrayAdapter,
BaseAdapter,
ListView
Subscribe to:
Posts (Atom)