BlurView 介绍
BlurView 是Android下类似 iOS 毛玻璃效果控件。
使用:
<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(this, true)) //Preferable algorithm, needs RenderScript support mode enabled .blurRadius(radius);
BlurView 官网
https://github.com/Dimezis/BlurView
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。