1

I imported the design library and android support v7 app-compact library from sdk.

then I wrote code for Floating action button as follows

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="16dp"
    android:clickable="true"
    android:src="@drawable/ic_done"
    app:layout_anchor="@id/viewA"
    app:layout_anchorGravity="bottom|right|end"/>

But shows the error, The following class could not be found:android.support.design.widget.FloatingActionButton

help me on this.

tenten
  • 1,276
  • 2
  • 26
  • 54
  • add the dependencies if not... clean the project.. and run it. – SRB Bans May 18 '16 at 11:10
  • try http://stackoverflow.com/a/31431076/3981656 or http://stackoverflow.com/a/30652875/3981656 – Sathish Kumar J May 18 '16 at 11:12
  • add design library from the sdk to your project as dependency, clean the project and try running it again – Mit May 18 '16 at 11:13
  • @Mit how to add as dependency in eclipse please help – tenten May 18 '16 at 11:14
  • @sourabhbans how to add as dependency in eclipse please help – tenten May 18 '16 at 11:18
  • @tenten Right click on project... Properties... select android section.... click on add libraries .. select Design support.. click on apply and Ok.. – SRB Bans May 18 '16 at 11:21
  • @sourabhbans no such path in eclipse :( – tenten May 18 '16 at 11:25
  • @tenten .. follow the process .. 1. remove the design support library from eclipse. 2. import it again.. NOTE : check the option copy into work space while import it. 3. Right click on Design support library >> Properties >>select Android tab >> check the option of Is Library >> change the compile sdk version if required. >> Click Apply and OK. 4. Now right click on your app project >> Properties >> select Android tab >>click on add >> select the design support library and click apply. – SRB Bans May 18 '16 at 11:32
  • @sourabhbans I already did that :( – tenten May 18 '16 at 11:38

0 Answers0