Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved class '@string/appbar_scrolling_view_behavior'

After i updated Android Studio i get this error in my xml for my viewpager. Weird thing is it works fine and the project builds without any problems.

What is the reason that '@string/appbar_scrolling_view_behavior' is an Unresolved class?

 <android.support.v4.view.ViewPager
     android:id="@+id/viewPager"
     android:layout_width="match_parent"
     android:layout_height="match_parent"           
     app:layout_behavior="@string/appbar_scrolling_view_behavior">
 </android.support.v4.view.ViewPager>

My viewpager is inside a CoordinatorLayout.

like image 202
Vince VD Avatar asked May 05 '19 22:05

Vince VD


1 Answers

Those who use or migrated to AndroidX, you can use the following fix to remove the error. This also works in Android Studio 3.4

app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
like image 180
Midhun Murali Avatar answered Oct 20 '22 23:10

Midhun Murali