让ImageView的android系统中部分不可 [英] Make ImageView partially invisible in android
问题描述
请ImageView的部分不可
Make ImageView partially invisible
我有以下加载条。我有中间的按钮图像,灰色圆圈和一个黄色圆圈的图像了。但我不知道我怎么能做出这样的装载吧?
I have following loading bar. I have middle button image, the gray circle and a yellow circle image too. But i am not sure how can I make such a loading bar?
- 一个想到的是,我的步伐黄圈在灰色cirle使其不可见,然后每一秒做一个部分可见。但我不知道我怎样才能使ImageView的可见部分和隐藏所有其他。
微红黄色进步,我有完全的位图可360度
The reddish yellow progress, I have complete bitmap available 360 degree
推荐答案
能否使用[ProgressDialog]:的 http://developer.android.com/reference/android/app/ProgressDialog.html
Could use [ProgressDialog]: http://developer.android.com/reference/android/app/ProgressDialog.html
我不很懂如何插入中间的按键在ProgressDialog的圈子。
I don't know very much how to insert the center button in the circle of ProgressDialog.
你想要的是,当你按下中间的按钮,该ProgressDialog会进步(黄色部分将会增长,而灰色部分将减少)?
What you want is when you push the center button, the ProgressDialog will progress (the yellow part will grow and the grey part will reduce) ?
ProgressDialog m_pDialog = new ProgressDialog(***class.this);
m_pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); // Set it to circle style
m_pDialog.setButton(R.drawable.img1); // Perhaps this can set the center button ? should change code
m_pDialog.setIndeterminate(false); // Make the progress displayed with a percentage rather than a constantly moving loading bar
m_pDialog.show();
添加一个点击监听器中间的按钮,它被点击时,启动线程进步的对话吧。
Add a click-listener to the center button, when it is clicked, start the Thread to progress the Dialog bar.
button.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
int m_count = 0;
new Thread() {
public void run() {
try {
while (m_count <= 100) {
m_pDialog.setProgress(m_count++);
Thread.sleep(100);
}
m_pDialog.cancel();
} catch (InterruptedException e) {
m_pDialog.cancel();
}
}
}.start();
}
});
这篇关于让ImageView的android系统中部分不可的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!