android - Custom progressbar is always in indeterminate mode and shows up as a square -
i trying use custom progress bar stuck in indeterminate mode when set false, , progressbar square. when supply width , height layoutparams, width of bar not match width set, instead matches height, making progressbar square.
here code:
progressbar pbrightextruder = new progressbar(this); linearlayout.layoutparams lpprogressbar = new linearlayout.layoutparams(linearlayout.layoutparams.match_parent, linearlayout.layoutparams.wrap_content); lpprogressbar.weight = 1; pbrightextruder.setlayoutparams(lpprogressbar); pbrightextruder.setprogress(50); pbrightextruder.setindeterminate(false); pbrightextruder.setindeterminatedrawable(getresources().getdrawable(r.drawable.progressbar)); pbrightextruder.setprogressdrawable(getresources().getdrawable(r.drawable.progressbar)); layoutrightextruder.addview(pbrightextruder);
what missing?
if useing weight
set width
0 instead of linearlayout.layoutparams.match_parent
. weight
work properlly. indeterminate
problem see this.
Comments
Post a Comment