I am learning android material design but in between it keeps giving an error. Can anyone help me on this?
workspace/RecyclerCardView/res/layout/list_item_row.xml:2: error: No resource identifier found for attribute 'cardCornerRadius' in package 'com.Zybo.recyclercardview'
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
card_view:cardCornerRadius="5dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/img_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="7dp" />
<TextView
android:id="@+id/txt_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hellooo..." />
</LinearLayout>
</android.support.v7.widget.CardView>
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
Above is sufficient.
Add these dependencies to build.gradle.
Use the keyword implementation
instead of compile
as it has been deprecated
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
then use
app:cardCornerRadius="5dp"
instead of
card_view:cardCornerRadius="5dp"
This worked for me
app:cardCornerRadius="5dp"
app:cardElevation="2dp"
Thanks all for trying to solve the question. At last I got the answer for my question:
sdk/extras/v7/cardview
sdk/extras/v7/recycleview
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With