2016-03-28 4 views
-1

Ich bin eine Karte hinzufügen Ansicht in einer einfachen Aktivität, wie ich es Code schreibe, zeigt Android Studio einen Fehler "Rendering Problem" Wie kann ich darüber kommen? Hier füge ich meinen Code an ..Wie kann ich eine Kartenansicht erstellen?

<?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

Posten Sie hier die ausreichende Protokoll, Fehler/Screenshot verwenden, um Ihr Problem zu lösen. –

Antwort

0

Fügen Sie Abhängigkeit in Ihrem build.gradle hinzu.

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

oder Rechtsklick auf Ausbau-> Einstellungen- zum Modul> Öffnen Abhängigkeiten Tab-> klicken Sie auf das Pluszeichen auf der rechten Seite Eck-> select Bibliothek dependency-> wählen cardview Bibliothek

+0

HI, danke für deine Hilfe, aber ich konnte das nicht in meinem Android Studio 1.5.1 finden –

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"/> 

Sie In http://schemas.android.com/apk/res-auto“es

0

Kompilierung 'com.android.support:cardview-v7:21.0.0'

: haben "card_view = xmlns" verpasst.

Verwenden Sie dies als eine Abhängigkeit in Ihrer build.gradle-Datei . Dies funktioniert möglicherweise in Android Studio 1.5.1.

P. S: Ich gehe davon aus, dass Sie 21 SDK Version> =