缺少样式。是否为此布局选择了正确的主题?使用布局上方的“主题”组合框选择其他布局,或修复主题样式引用。无法找到
mapViewStyle
当前主题的样式。
我尝试了所有可用于解决此问题的解决方案,但似乎无济于事。我已在清单文件中包含库。我什至创建的样式是styles.xml,我也选择了Google Apis构建目标。
有人可以给我解决办法吗?
这是我的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>
这是我的style.xml文件
<resources>
<style name="mapViewStyle" parent="@android:style/Theme.Black">
</style>
</resources>
minSDKVersion
和targetSdkVersion
在build.gradle
文件为我工作。
@style/AppTheme
您想念的吗?