2017-02-13 17 views
1

以及它給我,說對項目檢索項目的父項時出錯:找不到與給定名稱'Theme.AppCompat.Light.DarkActionBar'匹配的資源。視覺工作室xamarin

錯誤檢索父9 style.xml錯誤:沒有資源發現 給定的名稱「Theme.AppCompat.Light.DarkActionBar」錯誤不匹配資源 發現匹配給定的名字:attr'windowNoTitle'。

像我使用Visual Studio中xamarin

<?xml version="1.0" encoding="utf-8" ?> 
<resources> 

    <style name="Theme.Splash" parent="android:Theme"> 
    <item name="android:windowBackground">@drawable/splashscreen</item> 
    <item name="android:windowNoTitle">true</item> 
    <item name="android:windowActionBar">false</item> 
    </style> 

    <style name="MainTheme" parent="MainTheme.Base"> 
    </style> 
    <!-- Base theme applied no matter what API --> 
    <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <!--If you are using revision 22.1 please use just windowNoTitle. Without android:--> 
    <item name="windowNoTitle">true</item> 
    <!--We will be using the toolbar so no need to show ActionBar--> 
    <item name="windowActionBar">false</item> 
    <!-- Set theme colors from http://www.google.com/design/spec/style/color.html#color-color-palette --> 
    <!-- colorPrimary is used for the default action bar background --> 
    <item name="colorPrimary">#a84849</item> 
    <!-- colorPrimaryDark is used for the status bar --> 
    <item name="colorPrimaryDark">#444</item> 
    <!-- colorAccent is used as the default value for colorControlActivated 
     which is used to tint widgets --> 
    <item name="colorAccent">#a84849</item> 
    <!-- You can also set colorControlNormal, colorControlActivated 
     colorControlHighlight and colorSwitchThumbNormal. --> 
    <item name="windowActionModeOverlay">true</item> 

    <!--<item name="datePickerDialogTheme">@style/AppCompatDialogStyle</item>--> 
    </style> 

    <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog"> 
    <item name="colorAccent">#A84849</item> 
    </style> 
</resources> 
+0

一點觀察,你似乎是遞歸繼承你的主題。 'MainTheme'繼承自'MainTheme.Base','MainTheme.Base'似乎是繼承自'MainTheme'。 –

回答

0

就在您的解決方案>清潔。然後再次建立。

你也可以關閉並重新打開VS,它有助於那些奇怪的「找不到資源」錯誤。

也可以嘗試加入「安卓windowNoTitle」,而不是僅僅「windowNoTitle」

1

您不可以引用V7程序兼容性庫支持Android。它會顯示如下錯誤。

enter image description here

請加上支持V7程序兼容性庫形式的NuGet:

enter image description here

將構建成功: enter image description here

相關問題