【问题标题】:Blur Activity Background with Swipe in android在android中使用Swipe模糊活动背景
【发布时间】:2013-11-21 09:08:40
【问题描述】:

当我从右向左和从左向右滑动时,我需要模糊活动背景。我已经阅读了关于当 Android PopupWindow 处于活动状态时背景模糊或暗淡背景以及FLAG_DIM_BEHIND 的暗淡背景。但不能使用它,因为它用于使当前窗口后面的所有内容变暗。就我而言,没有其他窗户。在我的应用中,使用滑动手势对同一活动进行一些更改。

我该怎么做?

【问题讨论】:

    标签: android swipe android-gesture


    【解决方案1】:
    For Dimming Activity....
    
    getWindow().getAttributes().windowAnimations=R.style.PauseDialogAnimation;
            getWindow().getAttributes().flags=WindowManager.LayoutParams.FLAG_DIM_BEHIND;
            getWindow().getAttributes().dimAmount=0.5f;
    

    【讨论】:

    • R.style.PauseDialogAnimation 是什么?
    • 我没有对话框。清楚地阅读问题。我提到它是在我的情况下没有其他窗口。
    • 我为什么要删除那行?
    • 但仍然没有变化。屏幕没有变暗
    • 是的。它适用于对话。但不是我的情况,因为我没有 Dialog :(
    猜你喜欢
    • 2011-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-06
    • 2022-12-10
    • 2018-04-24
    • 1970-01-01
    相关资源
    最近更新 更多