我正在制作一个使用谷歌地图的应用程序.但是在我的xml中,我得到了错误"在当前主题中找不到样式'mapViewStyle'." 相反,我给了onternet权限,并在应用程序标记内使用了谷歌地图库.
任何人都可以帮助我.
非常感谢
以下是我的xml文件...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0ACHOtlugQlOP_-siR3LLyIBjv1SwpKWimIY8jw" />
</Relativelayout>
Run Code Online (Sandbox Code Playgroud)
Kar*_*amy 24
我的答案可能是迟到的,但我希望它能解决实际原因,并确保它可能对那些将来会搜索同一问题的人有所帮助.
这种错误,
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
Run Code Online (Sandbox Code Playgroud)
它可能是以上列表中的任何内容,
最终的原因是,
我们选择了不可用Theme
的layout
.
这可能是因为,
theme
内容在themes.xml
文件中不可用.theme
的属于更高版本sdk
,但我们当前的目标sdk
是较低的版本.这个问题大多发生,
layout
文件并尝试在你的文件中实现它project
.一个.您可能忘记复制themes.xml
文件b.您可能有较低的target sdk
,原始layout
创建更高target sdk
.这个问题的解决方案是,
(打开并查看了layout
在文件中Graphical Layout View
,并期待在右上角有你themes
的layout
已经被选中.)
theme
选项,并选择可用的themes
根据项目themes
和targeted sdk themes
.
(要么)theme
是custom
一个,如果您需要它,则将themes.xml
文件从您复制layout xml
文件的源复制到项目中.
(要么)theme
是sdk
无济于事theme
,如果你需要它,那么你改变target
根据您的选择theme
.希望,这可能对某人有帮助.
归档时间: |
|
查看次数: |
42965 次 |
最近记录: |