布局预览渲染问题:不支持PorterDuff颜色过滤器 [英] Layout Preview Rendering Problems: PorterDuff Color Filters are not supported

查看:213
本文介绍了布局预览渲染问题:不支持PorterDuff颜色过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android Studio 1.4中创建导航抽屉活动后,IDE会自动生成一些xml文件。

现在出现问题:

After I created a Navigation Drawer Activity in Android Studio 1.4, the IDE automatically generated some xml files.
Now there's a problem:

布局编辑器中的图形预览可能不准确:
- 不支持PorterDuff颜色过滤器。

这是我的activity_navi .xml

Here is my activity_navi.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_navi"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_navi"
        app:menu="@menu/activity_navi_drawer" />

</android.support.v4.widget.DrawerLayout>

我试图从activity_navi.xml中删除这些行,预览工作正常:

I tried to remove these lines from activity_navi.xml and the preview works fine:

<include layout="@layout/app_bar_navi" android:layout_width="match_parent"
    android:layout_height="match_parent" />

<android.support.design.widget.NavigationView android:id="@+id/nav_view"
    android:layout_width="wrap_content" android:layout_height="match_parent"
    android:layout_gravity="start" android:fitsSystemWindows="true"
    app:headerLayout="@layout/nav_header_navi" app:menu="@menu/activity_navi_drawer" />

我刚刚发现如果在布局预览中将API级别更改为20或21,问题就会消失!在我选择API 19之前。

I just found if I change API level to 20 or 21 in Layout Preview, the problem disappear! And before I picked API 19.

有谁知道如何解决这个问题?

Does anyone know how to solve this issue?

推荐答案

我遇到了同样的问题并解决了。
这是因为您的SDK版本太低,或Android版本太低。
通过更改SDK版本可以解决此问题,或者您可以更新SDK版本。

I've ran into the same problem and solved. It's because your SDK version is too low, or Android version is too low. By changing your SDK version would solve this problem, or you can update your SDK version.

这篇关于布局预览渲染问题:不支持PorterDuff颜色过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆