Search code examples
androidandroid-layoutandroid-stylesandroid-scrollview

Failed to find style 'scrollviewstyle' in current theme


I am creating a layout in which ScrollView is root element but i am getting this error in layout design tab

failed to find style 'scrollviewstyle' in current theme

This is xml file -

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.android.myapp.MainActivity">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            ...
            ...
            ...
        </RelativeLayout>
</ScrollView>

Solution

  • While I'm not too sure what exactly is your issue given the lack of context, one approach that have worked well for me is either:

    • Refresh your layout
    • Select a theme from the theme dropdown menu (refer to screenshot below) enter image description here

    This is because Android Studio (for some reason) could not find the theme you are using for your activity.

    Hope this helps