Извините, что публикую еще один из них, но, похоже, нам еще предстоит задокументировать каждое решение этой проблемы.
Вот что получилось :Я добавил вид карты, все заработало как на дрожжах. Я добавил выдвижной ящик и переместил в него кнопки, затем изменил корневой узел с линейного на относительный. С тех пор я получаю сообщение об ошибке в графическом макете моего класса main.xml, которое гласит
Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'mapViewStyle' in current theme.
Переключение корневого узла на линейный и обратно на относительный привело к отображению карты, но ошибка все еще находится в графическом макете.
До сих пор я сделал следующие решения, которые могут решить проблему в большинстве случаев:
<uses-library android:name="com.google.android.maps"/>
является дочерним узлом Application.Однако моя проблема сохраняется. Вот мой макет xml.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
style="@style/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:apiKey="asdf" //not my real key
android:clickable="true" />
<!-- TODO: update the API key with release signature -->
<SlidingDrawer
android:id="@+id/slidingDrawer1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/content"
android:handle="@+id/handle" >
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Menu" />
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/about"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about" />
<Button
android:id="@+id/record"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/record" />
<Button
android:id="@+id/start"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/start" />
</LinearLayout>
</SlidingDrawer>
</RelativeLayout>
Вот мой манифест xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.myschoolhere"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".GeoTagActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Если у кого-то есть решение, пожалуйста, дайте мне знать. Я сделаю все возможное, чтобы отправить обратно, если я когда-нибудь понять это.