缺少样式。是正确的主题选择了此布局?样式、布局、选择了、正确

2023-09-04 23:48:10 作者:与我无关(+999)

缺少样式。是正确的主题选择了此布局?使用上面的布局主题组合框中选择不同的布局,或固定的主题样式引用。无法找到当前主题风格 mapViewStyle

我试图用每一个解决方案来解决这个问题,但似乎没有任何工作。我已经包括在清单文件库。我甚至创造风格styles.xml,我选择了谷歌的API构建的目标也是如此。

有人可以请给我一个解决方案。感谢您提前为您的宝贵时间。

这是我的 XML 文件:

 < XML版本=1.0编码=UTF-8&GT?;
< RelativeLayout的的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
的xmlns:工具=htt​​p://schemas.android.com/tool​​s
风格=@风格/ AppTheme
机器人:layout_width =FILL_PARENT
机器人:layout_height =FILL_PARENT>


 < com.google.android.maps.MapView
     机器人:ID =@ + ID / themap
     风格=@风格/ mapViewStyle
     机器人:layout_width =FILL_PARENT
     机器人:layout_height =FILL_PARENT
     机器人:apiKey =在这里,我有我的钥匙
     机器人:可点击=真
     机器人:启用=真/>

  < / RelativeLayout的>
 

下面是我的清单片段:

 <使用库机器人:名称=com.google.android.maps/>

    <活动
        机器人:名称=。MainActivity
        机器人:标签=@字符串/ title_activity_main>
        <意向滤光器>
            <作用机器人:名称=android.intent.action.MAIN/>

            <类机器人:名称=android.intent.category.LAUNCHER/>
        &所述; /意图滤光器>
    < /活性GT;
    <活动机器人:二的名字= />

    <活动机器人:名称=机器人:主题=@安卓风格/ Theme.Black三。/>
  < /用途>
 

这是我的 style.xml 文件

 <资源>
    <样式名称=mapViewStyle父=@安卓风格/ Theme.Black>
    < /风格>
< /资源>
 
怎么换成windows10主题

解决方案

我有同样的问题,发现它是主题下拉的图形布局编辑器的顶部。我从河洛改为主题和布局显示和错误消失了。

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.

I tried every solutions available to solve this problem but nothing seems to work. I have included library in the manifest file. I even created style is styles.xml, I have chosen Google Apis build target as well.

Can somebody please give me a solution. Thank you in advance for your valuable time.

here is my xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/AppTheme"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >


 <com.google.android.maps.MapView
     android:id="@+id/themap"
     style="@style/mapViewStyle"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:apiKey="here i have my key"
     android:clickable="true"
     android:enabled="true" />

  </RelativeLayout>   

Here is my manifest snippet:

  <uses-library android:name="com.google.android.maps" />

    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".Second" />

    <activity android:name=".Third"  android:theme="@android:style/Theme.Black"/>
  </application>

here is my style.xml file

<resources>
    <style name="mapViewStyle" parent="@android:style/Theme.Black">
    </style>
</resources>

解决方案

I had the same problem and found it was the Theme dropdown at the top of the graphical layout editor. I changed from Holo to Theme and the layout displayed and error disappeared.

 
精彩推荐
图片推荐