ProgressDialog 背景活动淡出动画
我正在构建一个自定义 ProgressDialog,并希望背景 Activity 比默认情况褪得更快、更暗。唯一的问题是我不知道在哪里寻找处理 ProgressDialog 淡入淡出的动画。我已经从 ProgressDialog -> 上游工作了警报对话框 ->对话框,但在 java 中没有看到任何看起来有用的东西。我假设有一个动画 .xml 文件控制它,所以我正在寻找该文件,以及调用程序如何使用它。
为了更清楚一点,我指的动画是当弹出一个 ProgressDialog 时,之前活动的活动会逐渐变暗。我想获得对该动画的控制权。
I am building a custom ProgressDialog and would like for the background Activity to fade faster and darker than default. The only problem is I do not know where to look for the animation that handles the fading for a ProgressDialog. I have worked my way upstream from ProgressDialog -> AlertDialog -> Dialog but dont see anything in the java that looks useful. I am assuming there is an animation .xml file that controls it, so I am looking for that file, and how the calling program makes use of it.
Just to be a little more clear, the animation I am refering to is when a ProgressDialog pops up, the previously active activity fades to dark. I want to gain control of that animation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道改变背景调光的唯一方法是通过 android:backgroundDimEnabled 和 android:backgroundDimAmount 设置(完全打开/关闭背景调光并控制 要更改这些值
,请使用以下内容创建(或编辑)res/values/styles.xml 文件
,并将主题设置为
< strong>@style/Theme.ControlledDim
这可能无法提供您想要的那么多控制,但希望是朝着正确方向迈出的一步
(android:backgroundDimamount 的默认设置是 0.6 )
The only ways I know of to alter the background dimming are via the android:backgroundDimEnabled and android:backgroundDimAmount settings (to completely turn on/off the background dimming and to control the amount of background dimming, respectively)
To alter these values, create (or edit) your res/values/styles.xml file with the following
And apply that theme in the activity's manifest by setting the theme to
@style/Theme.ControlledDim
This may not offer as much control as you'd like but is hopefully a step in the right direction
(The default setting for android:backgroundDimAmount is 0.6)