我刚刚升级到 Android Studio 2.3,但是当我尝试显示这个布局时:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_margin="@dimen/card_margin"
android:elevation="3dp"
app:cardBackgroundColor="@color/transparent"
android:background="@color/transparent"
app:cardCornerRadius="@dimen/card_album_radius">
<RelativeLayout
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:clickable="true"
android:scaleType="fitCenter" />
<ImageView
android:id="@+id/alarm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/toolbar_alarm"
android:alpha="0.35"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:paddingBottom="@dimen/songs_count_padding_bottom"
android:paddingLeft="@dimen/album_title_padding"
/>
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/songs_count_padding_bottom"
android:paddingLeft="@dimen/album_title_padding"
android:paddingRight="@dimen/album_title_padding"
android:layout_toRightOf="@id/alarm"
android:layout_alignParentBottom="true"
android:textSize="@dimen/songs_count"
tools:text="Sample Title" />
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16sp"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:textColor="@color/album_title"
android:textSize="@dimen/note_card_title"
android:textStyle="normal"
/>
<ImageView
android:id="@+id/overflow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:scaleType="centerCrop"
android:src="@drawable/ic_dots" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
我从界面设计器(布局编辑器)收到此错误:
The following classes could not be found:
- android.support.v7.app.WindowDecorActionBar (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.ActionBarContainer (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.ActionBarContextView (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.ActionBarOverlayLayout (Fix Build Path, Edit XML, Create Class)
- android.support.v7.widget.ContentFrameLayout (Fix Build Path, Edit XML, Create Class)
点击Fix Build Path
或其他链接无效。