我刚刚下载并开始学习 android L material design api。每当我在我的活动中使用 CardView 时,它都会给我这个错误Failed to find style with id 0x7f070001 in current theme
。
这是我的 xml 布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res/com.flip.tesla"
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"
tools:context="com.flip.tesla.MainActivity$PlaceholderFragment" >
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="200dp"
app:cardElevation="10dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"
android:textSize="15sp" />
</android.support.v7.widget.CardView>
</RelativeLayout>
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
这是它显示的确切消息:
缺少样式。是否为此布局选择了正确的主题?使用布局上方的主题组合框选择不同的布局,或修复主题样式引用。
在当前主题中找不到 id 为 0x7f070001 的样式
编辑:所以我重新启动了 eclipse,这是它显示的新消息。
渲染期间引发异常:com.android.layoutlib.bridge.MockView 无法转换为 android.view.ViewGroup 异常详细信息记录在 Window > Show View > Error Log 中无法实例化以下类:- android.support.v7。小部件.CardView
关于这意味着什么的任何想法?