Я использую Eclipse, и я пытаюсь создать приложение, используя новый support-library-v7:21.+ из Lollipop.
- Создал мой новый проект
- импортируется в eclipse
support-library-v7 - изменено в
project-propertiesбиблиотеки поддержки строка:target=android-21с 21 целью - изменил цель моего приложения в 21
- импортировал библиотеку в мой проект
- очистить все
В конце концов я все еще получил недопустимое объявление R. Я перезапустил Eclipse, а затем, после повторного импорта библиотеки, похоже, пошел! Я создал Tolbar и NavigationDrawer, а также без проблем - он работает.
Теперь я хотел бы поместить CardView в мои ListView элементы:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
>
<!-- A CardView that contains a TextView -->
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_gravity="center"
android:layout_width="200dp"
android:layout_height="200dp"
card_view:cardCornerRadius="4dp">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/codename"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/versione"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/timestamp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</android.support.v7.widget.CardView>
</LinearLayout>
ну, первая ошибка: No resource identifier found for attribute 'cardCornerRadius'.
Я попытался удалить атрибут, перезапустить приложение, но я получил следующий сбой:
java.lang.RuntimeException: Binary XML file line #2: You must supply a layout_width attribute.
Я не понимаю, в чем проблема.