【发布时间】:2016-03-14 19:26:49
【问题描述】:
在更新为使用 23.3.1 支持库后,布局编辑器不会使用 app:srcCompat 属性呈现图像视图。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="?android:colorBackground"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="in.srain.demos.vector.MainActivity"
tools:showIn="@layout/activity_main">
<ImageView
android:id="@+id/vector_drawable_cpu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/vector_drawable_cpu"
/>
<ImageView
android:id="@+id/vector_drawable_cpu_ani"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/vector_drawable_cpu"
app:srcCompat="@drawable/animated_cpu"
/>
<TextView
android:id="@+id/status_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/vector_drawable_cpu"
android:layout_centerHorizontal="true"
android:padding="5dp"
android:textColor="?android:attr/textColorPrimary" />
</RelativeLayout>
Looks like this in the Layout Editor preview
有人知道如何解决这个问题吗?
【问题讨论】:
-
看我的回答here
标签: android android-studio android-support-library