当前位置: 首页 > 知识库问答 >
问题:

在Android清单文件中找不到与给定名称匹配的资源

蓟清野
2023-03-14

我是Android新手,请帮帮我,

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.blwsocietyuk.com.blwsocietyuk"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

    <!-- To auto-complete the email text field in the login form with the user's emails -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name="org.blwsocietyuk.com.blwsocietyuk.MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="org.blwsocietyuk.com.blwsocietyuk.SplashScreen"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/title_activity_splash_screen"
            android:theme="@style/FullscreenTheme" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="org.blwsocietyuk.com.blwsocietyuk.TrendingPosts"
            android:label="@string/title_activity_trending_posts"
            android:theme="@style/AppTheme.NoActionBar" >
        </activity>
        <activity android:name="org.blwsocietyuk.com.blwsocietyuk.Webview" >
        </activity>
    </application>

</manifest>

所以我在这里添加了我的风格

 <resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/myPrimaryColor</item>
        <item name="colorPrimaryDark">@color/myPrimaryDarkColor</item>
        <item name="colorAccent">@color/myAccentColor</item>
        <item name="android:textColorPrimary">@color/myTextPrimaryColor</item>
        <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
        <item name="windowActionModeOverlay">true</item>
        <item name="android:textColor">@color/black</item>
        <item name="android:windowBackground">@color/myWindowBackground</item>

    </style>
    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>
    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

    <!--<style name="AppThemeBar" parent="AppTheme">-->
    <!--</style>-->

    <style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
        <item name="spinBars">true</item>
        <item name="color">@android:color/white</item>
    </style>

    <style name="ToolBarStyle" parent="">
        <item name="popupTheme">@style/ThemeOverlay.AppCompat.Light</item>
        <item name="theme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
    </style>

    <style name="CardActionButton">
        <item name="android:textSize">16sp</item>
        <item name="android:textColor">@drawable/card_button</item>
        <item name="android:ellipsize">end</item>
        <item name="android:gravity">start|center</item>
        <item name="android:paddingLeft">16.0dip</item>
        <item name="android:paddingRight">4dp</item>
        <item name="android:maxLines">2</item>
        <item name="android:drawablePadding">4.0dip</item>
    </style>

    <style name="listTitle">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:lineSpacingExtra">1dp</item>
        <item name="android:paddingLeft">5dp</item>
        <item name="android:paddingTop">2dp</item>
        <item name="android:maxLines">2</item>
        <item name="android:ellipsize">end</item>
        <item name="android:textColor">@color/dark_gray</item>
        <item name="android:fontFamily">sans-serif-light</item>
        <item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
    </style>

    <style name="listStyle">
        <item name="android:clipToPadding">false</item>
        <item name="android:paddingTop">@dimen/activity_vertical_margin</item>
        <item name="android:paddingBottom">@dimen/activity_vertical_margin</item>
        <item name="android:paddingLeft">@dimen/activity_horizontal_margin</item>
        <item name="android:paddingRight">@dimen/activity_horizontal_margin</item>
    </style>

    <style name="listStyleNoHighlight">
        <item name="android:clipToPadding">false</item>
        <item name="android:paddingBottom">@dimen/activity_vertical_margin</item>
    </style>


</resources>

共有1个答案

林星阑
2023-03-14

您必须了解样式在android中是如何工作的,请参阅下面的链接以了解相同的http://developer.android.com/guide/topics/ui/themes.html

您已经定义了Android:theme=“@style/fullscreentheme”,但在res/values/styles.xml中没有

 类似资料: