ProgressBar.getProgressDrawable()
देता है जिसमें एक LayerDrawable
:
LayerDrawable progressDrawable = (LayerDrawable) getProgressDrawable();
Drawable backgroundColor = progressDrawable.getDrawable(0);
Drawable secondaryColor = progressDrawable.getDrawable(1);
Drawable primaryColor = progressDrawable.getDrawable(2);
मैं रंग तिनका (उदाहरण) को संशोधित करने का प्रयास करें:
progressDrawable.setDrawableByLayerId(progressDrawable.getId(2), new ClipDrawable(...));
लेकिन यहाँ एक example of ProgressBar
drawable कि एंड्रॉयड के साथ भेज दिया है कभी-कभी स्क्रीन फ्रीज, कभी-कभी दुर्घटनाग्रस्त हो जाती है। अंततः मैंने समय की कमी के लिए खोज छोड़ दी। क्षमा करें :(
मिशेल
मिशेल, यू समाधान कर रहे हैं? मैं इस समस्या के साथ भी अटक गया हूं :( – Peter
@ पीटर मेरा उत्तर नीचे देखें। – Michele