如何更改 ProgressDialog 的颜色

发布于 2024-12-25 01:00:33 字数 680 浏览 5 评论 0原文

我有一个在 Galaxy Tab 10.1" 上看起来像这样的 ProgressDialog
在此处输入图像描述

并在 Galaxy Tab 7 上像这样“
在此处输入图像描述

我希望两个对话框看起来相同:
我得到的最接近的是使用以下样式

结果是这样的 在此处输入图像描述

所以我的问题是:
- 如何删除“请稍候”标题周围的边框?
- 如何将整体边框从蓝色更改为白色?
- 如何调整/减少宽度?

I have a ProgressDialog that looks like this on a Galaxy Tab 10.1"
enter image description here

and like this on a Galaxy Tab 7"
enter image description here

I want both Dialogs to look the same:
The closest that I get is by using the following style

<style name="popupStyle" parent="android:Theme.Dialog">
<item name="android:textColor">#FFFFFFFF</item>
<item name="android:background">#FF000000</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>

which results in this
enter image description here

So my questions are:
- How can I remove the border around the "Please wait" title?
- How can I change the overall border from blue to white?
- How can I adjust/reduce the width?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巨坚强 2025-01-01 01:00:33
progressDialog = new ProgressDialog(context):    
progressDialog.show();  
TextView tv1 = (TextView) progressDialog.findViewById(android.R.id.message);  
tv1.setTextSize(20);  
tv1.setTypeface(yourCustomTF);  
tv1.setText("your msg");  

通过这种方式,您可以更改消息文本,还可以通过从显示的 ProgressDialog 获取其组件来自定义整个视图。请记住,您可以在progressDialog.show()之后使用findViewById()获取视图Id,因为视图是在show()之后生成的。

progressDialog = new ProgressDialog(context):    
progressDialog.show();  
TextView tv1 = (TextView) progressDialog.findViewById(android.R.id.message);  
tv1.setTextSize(20);  
tv1.setTypeface(yourCustomTF);  
tv1.setText("your msg");  

By doing it this way, you can change the message text and also customize the entire view by getting their components from the ProgressDialog that is shown. Remember, you can get the view Id by using findViewById() after progressDialog.show() because the view is generated after show().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文