2

我剛剛升級到Android 2.3工作室,但是當我試圖顯示此佈局:的Android 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或其他鏈接不起作用。

+1

您的build.gradle文件中是否存在所有必需的支持庫(v7)?似乎他們無法找到。 –

回答

0

嘗試查看你的依賴。更新到Android Studio 2.3後,我的Gradle破了。

See details