java – 布局预览渲染问题:不支持PorterDuff颜色过滤器
发布时间:2020-10-19 18:03:28 所属栏目:Java 来源:互联网
导读:在 Android Studio 1.4中创建导航抽屉活动后,IDE会自动生成一些xml文件. 现在有一个问题: 布局编辑器中的图形预览可能不准确: – 不支持PorterDuff颜色过滤器. 这是我的activity_navi.xml ?xml version=1.0 encoding=utf-8?android.support.v4.widget.Drawe
在
Android Studio 1.4中创建导航抽屉活动后,IDE会自动生成一些xml文件.
布局编辑器中的图形预览可能不准确: 这是我的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中删除这些行,预览效果很好: <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. 有谁知道如何解决这个问题? 解决方法我遇到同样的问题,解决了. 这是因为您的SDK版本太低,或Android版本太低. 通过更改SDK版本可以解决这个问题,或者你可以更新你的SDK版本.(编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |