How to programmatically add a ProgressBar?

I want to put a ProgressBar ontop from a ListView programmatically, but not an XML editor.

arProgressBar = new ProgressBar(this);

How can i achieve this?

+3
source share
2 answers

Try placing an empty view above the listView, then create a progress bar and try adding it as a child of the empty view.

+1
source

Why can't you just hide it and show it when you need to?

: progressBar.setVisibility(View.VISIBLE) progressBar.setVisibility(View.GONE), /, . : visibility = "" XML, ( - ), .

0

All Articles