Android地图:无法找到风格'mapViewStyle“在当前主题 [英] Android maps:Failed to find style 'mapViewStyle' in current theme
问题描述
我想使用的地图在我的应用程序,我得到这个错误, 无法找到风格'mapViewStyle在当前主题
I am trying to use maps in my application and i get this error, Failed to find style 'mapViewStyle' in current theme
我已经生成的密钥正确,并试图在其他地方提供了同样的问题,所有的解决方案。
i have generated the key properly, and have tried all solutions offered for the same problem at other places.
1.my target api and the one mentioned in the manifest file are the same.
2.There is no import.R in my project
3.I have cleaned my project.
4.Uses-library element is a child of the application.
这是我的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:apiKey="*****************"
android:enabled="true"
/>
</LinearLayout>
这就是我的对应的Java文件
and this is my corresponding java file
包com.epidemicator.prototype;
package com.epidemicator.prototype;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class Mapacti extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
请帮我在这里... 谢谢。
please help me out here... thanks.
推荐答案
我的回答可能是晚了,但我希望它会与实际的原因,并确保交易可能是为那些谁是要寻找有帮助关于未来的同样的问题。
My answer may be a late one, but i hope that it'll deals with the actual reason and sure it could be helpful for those who are going to search about the same problem in future.
这类型的错误,
1. Android Google Maps Failed to find style 'mapViewStyle' in current theme
2. Failed to find style 'imageButtonStyle' in current theme
3. Failed to find style 'editTextStyle' in current theme
4. Failed to find style 'textViewStyle' in current theme
任何东西,从上述列表中它可以是
Anything from the above list it may be,
的根本原因是,
我们选择了不可用主题
为布局
。
这可能会导致因为,
- 选中
主题
不是的themes.xml
文件。 可用
- 选中
主题
是属于更高版本SDK
,但我们目前的目标SDK
是较低的。
- The selected
theme
is not available inthemes.xml
file. - The selected
theme
is belongs to higher versionsdk
, but our current targetsdk
is lower one.
这个问题大多发生,
- 当你复制整个
布局
文件,并尝试在你的实施IT项目
。 一个。您五月忘了复制的themes.xml
文件 湾您可能有更低的目标SDK
,原布局
较高目标SDK创建
。
- when you copy the whole
layout
file and try to implement it in yourproject
. a. Your may forgot to copythemes.xml
file b. You may have lowertarget sdk
, the originallayout
created with highertarget sdk
.
对于这个问题的解决方案是,
The Solutions for this problem are,
(打开在图形布局视图<和查看的
布局
文件/ code>,并期待在右上角。
有你的主题
为布局
已选定。)
(Open and View the layout
file in the Graphical Layout View
, and look at the top Right corner.
There your themes
for the layout
have been selected.)
- 那么单击下拉列表
主题
选项,并选择可用的主题
根据项目主题
和目标SDK主题
。 (OR) - 如果在
主题
是自定义
一,如果你需要它,然后复制的themes.xml
文件,从您复制布局XML
文件的源项目。 (OR) - 如果在
主题
是SDK
果主题
,如果你需要的话,那么根据您选择的主题
。 更改
目标
- So click the dropdown list for
theme
selection and choose the availablethemes
according to your projectthemes
andtargeted sdk themes
. (OR) - If the
theme
is acustom
one , if you are required it , then copy thethemes.xml
file to your project from the source where you copied thelayout xml
file. (OR) - If the
theme
issdk
availtheme
, if you are required it , then change yourtarget
according to your selectedtheme
.
希望,这可能是别人有帮助的。
Hope,This might be helpful for somebody.
这篇关于Android地图:无法找到风格'mapViewStyle“在当前主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!