android.support.v7.widget.cardview cannot be found -
i'm using android studio 1.2.2 , attempting use cardview in layout, preview giving me warning class android.support.v7.widget.cardview not found. question has been asked various times, , have looked @ these solutions:
error when adding cardview layout
android.support.v7.widget.cardview not found (android studio 1.1 preview)
but none of them have answer. have added gradle:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:cardview-v7:21.0.+' }
and have added layout:
xmlns:card_view="http://schemas.android.com/apk/res-auto"
which pretty sums answers given on 2 similar questions asked, still getting same error, , when run on device, cardview doesn't show @ all. can point out other possible solutions?
by way, minsdkversion 21.
layout:
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="integraloftan.cardview.main"> <android.support.v7.widget.cardview android:layout_width="fill_parent" android:layout_height="wrap_content" android:elevation="100dp" card_view:cardcornerradius="8dp"> </android.support.v7.widget.cardview>
and gradle:
apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "21.1.2" defaultconfig { applicationid "integraloftan.match" minsdkversion 21 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:cardview-v7:22.2.0' }
first of all, sorry if made unclear: set buildtoolsversion
22.0.1
secondly, cardview
doesn't have children , height
set wrap_content
, that's why don't see anything. try setting height fixed value 100dp
, see if appears.
Comments
Post a Comment