Reputation: 60859
I want to put a ProgressBar ontop of a ListView programmatically, and not though the XML editor.
arProgressBar = new ProgressBar(this);
How can I achieve this?
Upvotes: 3
Views: 1296
Reputation: 6177
Try putting an empty view above listView, then create your progress bar, and try adding it as a child of the empty view.
Upvotes: 1
Reputation: 30168
Why can't you just hide it and show it when you need to?
Use: progressBar.setVisibility(View.VISIBLE) and progressBar.setVisibility(View.GONE) to show it/hide it, respectively. Set the android:visibility="gone" in the XML so it's invisible (and does not affect any of the other components' positions) until you need to show it.
Upvotes: 0