【发布时间】:2013-06-04 05:20:36
【问题描述】:
经过大量研究,但没有找到任何东西...快速提问,有人知道为什么 Android Studio 不使用 Map 标签吗?下面的代码是 SDK 中地图示例的片段。已经添加了 google play services 库和支持,但没有。
显示错误
Unexpected namespace prefix "map" found for tag fragment.
提前非常感谢!
<fragment
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"
map:cameraZoom="10" />
【问题讨论】:
-
听起来很像这个 Eclipse 错误:code.google.com/p/android/issues/detail?id=53283
-
所以似乎唯一的解决方案是在 java 代码而不是 xml 文件上执行此操作,对吗?谢谢你!
-
是的,AFAIK 实现此功能的唯一可靠方法是通过 Java 代码。这是一个错误,希望有一天会得到修复......
-
问题是它在 Eclipse 上运行良好,我只需添加对 google play 服务的引用就可以了,但 Android Studio 没有。再次感谢 CommonsWare!
-
Android Studio 1.4 仍然存在这个问题。显示 Xml 错误,但工作正常。只需忽略这一点。
标签: android android-layout android-xml android-studio