Bil*_*ldr 21 eclipse android android-layout android-mapview
很抱歉发布另外一个,但似乎我们还没有记录这个问题的每个解决方案.
这是发生了什么:我添加了mapview,一切都在工作.我添加了一个滑动抽屉并将按钮移入其中,然后将根节点从线性更改为相对.从那时起,我在读取的main.xml类的图形布局中出现错误
缺少风格.是否为此布局选择了正确的主题?使用布局上方的主题组合框选择不同的布局,或修复主题样式引用.无法在当前主题中找到样式'mapViewStyle'.
将根节点切换为线性并返回到相对位置已使地图显示,但错误仍在图形布局中.
到目前为止,我已经完成了以下解决方案,可以解决大多数情况下的问题:
<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>
如果有人有解决方案,请告诉我.如果我弄清楚的话,我会尽力回复.
Kar*_*amy 10
我的答案可能是迟到的,但我希望它能解决实际原因,并确保它可能对那些将来会搜索同一问题的人有所帮助.
这种错误,
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 
它可能是以上列表中的任何内容,
最终的原因是,
我们选择了不可用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.希望,这可能对某人有帮助.
| 归档时间: | 
 | 
| 查看次数: | 30565 次 | 
| 最近记录: |