2015-10-12 11 views
12

मैं Styles.xml फ़ाइलों में कुछ आइटम जोड़ रहा हूं। हालांकि, यह मुझे एक त्रुटि दे रहा है।कोई संसाधन नहीं मिला कि दिए गए नाम को मच करें Theme.AppCompat.Light.NoActionBar

मेरा कोड यहां है।

<?xml version="1.0" encoding="UTF-8" ?> 
<resources> 
    <style name="MyTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
     <item name="colorPrimary">#2196F3</item> 
     <item name="drawerArrowStyle">@style/MyDrawerArrowStyle</item> 
    </style> 
    <style name="MyDrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle"> 
     <item name="color">#F5F5F5</item> 
     <item name="spinBars">true</item> 
    </style> 
</resources> 

त्रुटि नीचे

error screenshot

  1. त्रुटि आइटम के लिए माता-पिता को पुन: प्राप्त स्क्रीनशॉट में देखा जा सकता है: नहीं संसाधन दिए गए नाम से मेल खाता पाया 'Theme.AppCompat.Light.NoActionBar'।
  2. कोई संसाधन नहीं मिला जो दिए गए नाम से मेल खाता है: attr 'colorPrimary'।
  3. कोई संसाधन नहीं मिला जो दिए गए नाम से मेल खाता है: attr 'drawerArrowStyle'। 4.. कोई संसाधन नहीं मिला है जो दिए गए नाम 'Widget.AppCompat.DrawerArrowToggle' से मेल खाता है।
  4. कोई संसाधन नहीं मिला जो दिए गए नाम से मेल खाता है: attr 'color'।
  5. कोई भी संसाधन नहीं मिला जो दिए गए नाम से मेल खाता है: attr 'spinBars'।

उत्तर

0

मुझे याद नहीं है कि Theme.AppCompat.Light.NoActionBar पहले स्थान पर मौजूद है या नहीं।

आप इस के बजाय की तरह कुछ कर सकता है:

<style name="MyTheme" parent="Theme.AppCompat.Light"> 
    <item name="colorPrimary">#2196F3</item> 
    <item name="drawerArrowStyle">@style/MyDrawerArrowStyle</item> 
    <item name="windowActionBar">false</item> 
    <item name="android:windowNoTitle">true</item> 
</style> 
+0

धन्यवाद पनीरबार – Bikash

0

यहाँ उन समस्याओं को ठीक करने के लिए कदम हैं। 1) AndroidManifest.xml पर जाएं और एंड्रॉइड जोड़ें: targetSdkVersion 23 के उपयोग-एसडीके टैग के तहत। 2) प्रोजेक्ट पर जाएं -> सामान्य और एंड्रॉइड 6.0 (मार्शमलो) में लक्ष्य ढांचे को सेट करें। 3) प्रोजेक्ट पर जाएं -> एंड्रॉइड एप्लिकेशन -> एंड्रॉइड 6.0 पर एंड्रॉइड वर्जन सेट करें।

एंड्रॉइड संस्करण 7.0 नवीनतम Xamarin स्टूडियो में संकलित नहीं है। अभी आप एंड्रॉइड प्रोजेक्ट को एंड्रॉइड 6.0 तक संकलित कर सकते हैं।

+0

मुझे नहीं लगता कि यह अब मामला है। – shortstuffsushi

0
add component Support Library v7 AppCompat 

create values/styles and add 
<?xml version="1.0" encoding="utf-8" ?> 
<resources> 

    <style name="MyTheme" parent="MyTheme.Base"> 
    </style> 
    <style name="MyTheme.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">#2196F3</item> 
    <!-- colorPrimaryDark is used for the status bar --> 
    <item name="colorPrimaryDark">#1976D2</item> 
    <!-- colorAccent is used as the default value for colorControlActivated 
     which is used to tint widgets --> 
    <item name="colorAccent">#FF4081</item> 
    <!-- You can also set colorControlNormal, colorControlActivated 
     colorControlHighlight and colorSwitchThumbNormal. --> 
    </style> 
</resources> 

add another folder values-v21 
create styles.xml and add 
<?xml version="1.0" encoding="utf-8" ?> 
<resources> 
    <!-- 
     Base application theme for API 21+. This theme replaces 
     MyTheme from resources/values/styles.xml on API 21+ devices. 
    --> 
    <style name="MyTheme" parent="MyTheme.Base"> 
    <item name="android:windowContentTransitions">true</item> 
    <item name="android:windowAllowEnterTransitionOverlap">true</item> 
    <item name="android:windowAllowReturnTransitionOverlap">true</item> 
    <item name="android:windowSharedElementEnterTransition">@android:transition/move</item> 
    <item name="android:windowSharedElementExitTransition">@android:transition/move</item> 
    </style> 
</resources> 
संबंधित मुद्दे

 संबंधित मुद्दे