仿IOS毛玻璃效果BlurView

来源:互联网 发布:mac如何删除应用 编辑:程序博客网 时间:2024/06/06 18:32
BlurView 详细介绍

BlurView 是Android下类似 iOS 毛玻璃效果控件。

alt tag

使用:

  <eightbitlab.com.blurview.BlurView      android:id="@+id/blurView"      android:layout_width="match_parent"      android:layout_height="wrap_content"      app:overlayColor="@color/colorOverlay">       <!--Any child View here, TabLayout for example-->  </eightbitlab.com.blurview.BlurView>
    final int radius = 16;    final View decorView = getWindow().getDecorView();    //Activity's root View. Can also be root View of your layout    final View rootView = decorView.findViewById(android.R.id.content);    //set background, if your root layout doesn't have one    final Drawable windowBackground = decorView.getBackground();    blurView.setupWith(rootView)           .windowBackground(windowBackground)           .blurAlgorithm(new RenderScriptBlur(thistrue)) //Preferable algorithm, needs RenderScript support mode enabled           .blurRadius(radius);
原创粉丝点击