android进度条背景不透明度

时间:2012-06-13 06:03:56

标签: android opacity android-progressbar

我一直在使用Android ProgressBar。 这里唯一的东西是特定的应用程序,我需要ProgressBar没有半透明的背景。我的意思是你仍然可以看到它背后的视图,因为进度条是半透明的。

实际上我需要一个完整的背景不透明度(黑色,白色,无所谓)。只要后面板可以使用进度条隐藏 我不能只使用Panel本身并设置背景,因为它是一个Web面板(JS正在发生的事情)。

感谢您的回复

问候

2 个答案:

答案 0 :(得分:2)

试试这个:

TextView tv = (TextView) progressDialog.findViewById(android.R.id.message);
tv.setTextColor(Portlet.MessageFontColor);

View v = (View) tv.getParent();
((ScrollView) v).setBackgroundColor(Portlet.messageBackColor);

v = (View) v.getParent();
v.setBackgroundColor(Portlet.messageBackColor);

LinearLayout ll = (LinearLayout) v.getParent();
ll.setBackgroundColor(Portlet.messageBackColor);

答案 1 :(得分:0)

我解决了我的问题。 实际上我创建了自己的自定义进度条。 可以在这里找到一个例子: Create you Custom Progress Dialog

然后我用这种方法模糊了对话框的背景: Blur Dialog

希望有所帮助!

相关问题