i want to use vertical ProgressBars. By default they are not available in Android, so i tri开发者_C百科ed to put them in a LinearLayout and rotate it by 90 degrees. The problem is, the LinearLayout doesn´t resize after the animation, so I tried to put some manual resize into the AnimationListener:
Listener:
public void onAnimationEnd(Animation animation) {
changeBarLayoutBounds();
}
...
Activity:
private void changeBarLayoutBounds() {
int newWidth = params.height; // the params I copied before animation
params.height = params.width
params.width = newWidth;
barLayout.setLayoutParams(params);
barLayout.requestLayout();
}
This method somehow doensn´t work at all, does anybody have an idea?
Thank you.
You could create a custom progress bar. HERE you can find an example. Just use clip and set gravity to top or bottom and use 9-pathes that could grow vertically. Hope this helps.
精彩评论