How to customize ListView with ToggleButtons
I am making an android application.I have ListView in it which contains four rows having textView i.e Hide Unhide Add Users Delete users I want to add ToggleButton in ListView for first two rows but don n't want to show it for other rows. How can i customize my ListView in this way. Any help will be appreciated
You have to write a custom BaseAdapter. There you have the method getView() that is called for each listItem, so this is the right palce to define the layout of the listItems.
Please look at this article to ensure a smooth scrolling of your list.
And you can find a good Tutorial on Vogellas site.
If you want to add toggle button for first two rows only and not for all rows then one easy thing you can do is add in the custom listview layout file both the textview and toggle button but while implementing add (null) in the toggle button's place in the adapter for the rows for which you don't want the toggle button...