hadis
hadis

Reputation: 87

why Android Studio doesn't recognize CollapsingToolbarLayout?

I want to make collapsing Toolbar, at first i add

compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'

and then in main_activity I make CollapsingToolbarLayout and i give its attribute values:

 app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:expandedTitleTextAppearance="@android:color/transparent"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"> 

but when I press Run my android doesn't recognize this library and shows me this error

enter image description here

what's wrong with this library? how can I solve this problem? I'd appreciate to show me a solution

Upvotes: 0

Views: 140

Answers (1)

Paresh Mayani
Paresh Mayani

Reputation: 128428

I think this issue is due to missing "app" namespace in xml layout.

To resolve it, include xmlns:app="http://schemas.android.com/apk/res-auto" namespace line right after xmlns:android="http://schemas.android.com/apk/res/android"

Upvotes: 1

Related Questions