Android Question ListView - hot to use it inside a Panel

semar

Active Member
Licensed User
Longtime User
All,
I'm new to B4A and I'm using the demo version right now.

I would like to accomplish the following scenario:

A Tabview with some Tabs on it. On a Tab there are buttons. When I click on a button, the buttons on the current Tab should disappear while a ListView and a confirm button should appear inside the Tab.
I select an item on the ListView, press the confirm button and the ListView (together with the confirm button) should disappear while the (others) buttons should again be shown inside the current Tab. In the meantime the Tabview remains visible with the current Tab selected.

I get the whole picture using panels, each panel loads a layout where the related controls (buttons, labels and the like) are positioned. The Panels are shown and hide as requested.

But I can't get it working using a ListView.

If I set the parents Listview being a Panel, the Listview will never be shown.

If I load the ListView in the Activity (like the example found on the docs), the ListView appears, but is shown on the top of the whole TabView and controls, and can't be hidden.

In other terms, when I want to hide the ListView, neither myListView.visible = false nor myPanel.visible = false produces the wanted effect, that is, the ListView remains visible and occupies the whole surface of the Activity, and covers all the other controls (e.g. buttons) that are on the same Layout.

Any help would be greatly appreciated,
Sergio.
 

klaus

Expert
Licensed User
Longtime User
Without seeing your code it's impossible to give you a concrete advice.
You could have a layout with a panel containing the buttons which you add to the TabHost.
And onother layout with the ListView and the confirm button.
This layoud you load it onto the panel of the other layout.
And then you can hide or show the listview panel.
 
Upvote 0
Top