Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the Android progressbar's height?

My activity_main.xml is below, as you see, the height is set 40 dip.

And in MyEclipse, it looks like below:

enter image description here

But when I run it on my phone, it looks like below:

enter image description here

So my question is why the real height of the progressbar is not the one I set? How to increase the height of the progressbar?

like image 570
Tom Xue Avatar asked Nov 22 '12 09:11

Tom Xue


People also ask

How to change progress bar size in Android?

You can use LayoutParams to change width and height to whatever you want. ProgressBar progressBar = new ProgressBar(teste. this, null, android. R.

How do I make my progress bar horizontal Android?

In Android, by default a progress bar will be displayed as a spinning wheel but If we want it to be displayed as a horizontal bar then we need to use style attribute as horizontal. It mainly use the “android. widget. ProgressBar” class.

How can I increase my Seekbar height?

You can do this via XML. It will work fine in your application.do this simple integration in your XML where you have mentioned the Progress Bar tag. Edit the maxHeight to your desired height what you want to achieve. It will work perfectly.


1 Answers

I guess the simplest solution would be:

mProgressBar.setScaleY(3f); 
like image 166
Martin Pfeffer Avatar answered Oct 13 '22 04:10

Martin Pfeffer