Я добавил FloatingActionButton зависимость к моему Gradle файл, он был успешно скомпилирован:FloatingActionButton ошибка библиотеки компиляции
compile 'com.melnykov:floatingactionbutton:1.3.0'
Я добавил следующий XML в мой фрагмент макета:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.melnykov.fab.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
android:src="@drawable/ic_action_content_new"
fab:fab_colorNormal="@color/primary"
fab:fab_colorPressed="@color/primary_pressed"
fab:fab_colorRipple="@color/ripple" />
</FrameLayout>
Теперь, во время компиляции я получите следующие ошибки:
Error:(17, 22) No resource found that matches the given name (at 'src' with value '@drawable/ic_action_content_new').
Error:(18, 30) No resource found that matches the given name (at 'fab_colorNormal' with value '@color/primary').
Error:(19, 31) No resource found that matches the given name (at 'fab_colorPressed' with value '@color/primary_pressed').
Error:(20, 30) No resource found that matches the given name (at 'fab_colorRipple' with value '@color/ripple').
Что я должен установить?
вам больше не нужна эта библиотека, FAB включен в поддержку, теперь – njzk2