2016-03-28 7 views
-1

カードを追加していますシンプルなアクティビティで、コードを書いているので、Androidスタジオでエラーが表示されます。「レンダリングの問題」 どうすればいいですか?ここで私のコードを添付しています..カードビューを作成するにはどうすればよいですか?

<?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" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="com.example.sj.digitalapplications1.MainActivity" 
    tools:showIn="@layout/activity_main"> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Digital Application Android Team" 
     android:textSize="32sp" 
     android:gravity="center" 
     android:id="@+id/textView" /> 

    <android.support.v7.widget.CardView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/cv" 
     > 
    </android.support.v7.widget.CardView> 

</RelativeLayout> 
+0

ポストあなたの問題を解決することができ、十分なログ、エラー/スクリーンショットSDKのバージョンを使用していることを前提としています。 –

答えて

0

あなたのbuild.gradleに依存関係を追加します。プロジェクト - 上

dependencies {  
    compile 'com.android.support:cardview-v7:23.1.1'  
} 

または右クリック> [設定]> [開く]の依存関係タブ - をモジュールに行く>右corner->を選択し、ライブラリ上のプラス記号をクリックしdependency-> cardviewライブラリを選択

+0

こんにちは、おかげさまで、私のアンドロイドスタジオ1.5.1でこれを見つけることができませんでした –

0
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/smartbro_perc" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center"/> 

ますhttp://schemas.android.com/apk/res-auto」それは

0

コンパイル 'com.android.support:cardview-v7:21.0.0'

を追加します。 "card_view =のxmlns" 逃しました。

これをbuild.gradleファイルの依存関係として使用します。これはAndroid Studio 1.5.1でも有効です。

P.S:私はあなたがここに> = 21

関連する問題