缺少风格。是否为此布局选择了正确的主题?使用布局上方的“主题”组合框可选择不同的布局,或修复主题样式引用。在当前主题中找不到样式
mapViewStyle
。
我尝试了所有可用的解决方案来解决这个问题,但似乎没有一个是有效的。我已经在清单文件中包含了库。我甚至创建了 style is styles.xml,我也选择了 GoogleApis 构建目标。
有人能给我一个解决方案吗?
这是我的 Xml文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/AppTheme"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/themap"
style="@style/mapViewStyle"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="here i have my key"
android:clickable="true"
android:enabled="true" />
</RelativeLayout>
以下是我的 清单片段:
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Second" />
<activity android:name=".Third" android:theme="@android:style/Theme.Black"/>
</application>
这是我的 Xml文件
<resources>
<style name="mapViewStyle" parent="@android:style/Theme.Black">
</style>
</resources>