简体   繁体   中英

Styles.xml not working in android studio

I have created an app in android studio in ubuntu. Now I have moved the project to Windows 10. I have updated the studio now. The styles.xml resources are unable to identify the themes given in the parent attribute(all of them).

This is my styles.xml file

<!-- Base application theme. -->
<style  name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">#f44336</item>
    <item name="colorPrimaryDark">#e53935</item>
    <item name="colorAccent">#f44336</item>
    <item name="showcaseViewStyle">@style/CustomShowcaseTheme</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>

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">

</style>

<style name="checkbox" parent="Theme.AppCompat.Light">
    <item name="colorControlNormal">@color/black</item>
    <item name="colorControlActivated">@color/black</item>
</style>



<style name="layoutmargin">
    <item name="android:layout_marginTop">20dp</item>
    <item name="android:background">@color/white</item>
    <item name="android:layout_marginLeft">20dp</item>
    <item name="android:layout_marginRight">20dp</item>
</style>


<style name="CustomShowcaseTheme" parent="ShowcaseView.Light">
    <item name="sv_backgroundColor">#90234A56</item>
    <item name="sv_buttonBackgroundColor">#CF3119</item>
    <item name="sv_buttonText">Close</item>
    <item name="sv_titleTextAppearance">@style/CustomTitle</item>
    <item name="sv_detailTextAppearance">@style/CustomDetailText</item>
</style>
<style name="CustomTitle" parent="TextAppearance.ShowcaseView.Title">
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:textSize">30dp</item>
    <item name="android:textStyle">bold</item>
</style>

<style name="CustomDetailText" parent="TextAppearance.ShowcaseView.Detail">
    <item name="android:textColor">#FFFFFF</item>
    <item name="android:textSize">20dp</item>
    <item name="android:textStyle">italic</item>
</style>

All the parent attributes are showing that symbol cannot be resolved.

Are you sure, that the Android SDK version is the same as on your Ubuntu system? I am not sure if it is an issue with Android studio itself or the SDK. Did you also try to rebuild the project? Internal IDE parsing errors are not always reliable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM