不支持模糊遮罩滤镜

时间:2016-08-29 10:24:47

标签: android xml android-studio android-rendering

我有一个扩展View类的自定义类,我只是在绘制一些自定义位图。现在问题是每当我在xml中使用该类时,它都会产生渲染问题。

这是我的XML代码:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.custom.DrawingView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</RelativeLayout>

我在xml中没有其他任何东西,但仍然有错误,我也在为它分享截图,请查看以下内容。

enter image description here

在我的自定义View类中,我也使用了BlurMaskFilter

BlurMaskFilter blurMaskFilter = new BlurMaskFilter(5,
            BlurMaskFilter.Blur.NORMAL);

如您所见,我无法看到我的布局预览,甚至没有组件树

配置:

Android studio : 2.1.3
classpath 'com.android.tools.build:gradle:2.1.3'

compileSdkVersion 24
buildToolsVersion "24.0.0"

1 个答案:

答案 0 :(得分:0)

android:hardwareAccelerated="false"中为您的活动设置AndroidManifest.xml,如下所示:

 <activity android:name=".MyActivity" android:hardwareAccelerated="false">

它对我来说很好。