Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android's FloatingActionButton has a rendering exception

Exception raised during rendering:

Color value '?attr/colorAccent' must start with # (2 similar errors not shown)

What does this mean? The documentation isn't very good on the support library. Does anybody have a good example of how to implement the FloatingActionButton?

like image 782
George Avatar asked Nov 10 '22 10:11

George


1 Answers

please try selecting the color for your Fab in this way:

fab:button_color="@android:color/holo_blue_bright"

Take a look for my full implementation.

<com.software.shell.fab.FloatingActionButton
    android:id="@+id/sub_category_fab"
    fab:type="DEFAULT"
    android:visibility="visible"
    fab:button_color="@android:color/holo_blue_bright"
    fab:image="@mipmap/ic_add_white_24dp"
    fab:image_size="@dimen/fab_image_size"
    fab:hide_animation="@anim/fab_roll_to_right"
    fab:show_animation="@anim/fab_roll_from_down"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="false"
    android:layout_alignParentRight="true"
    android:layout_alignParentBottom="true"
    android:layout_margin="@dimen/fab_margin"
    />
like image 71
David Alejandro Burgos Rodas Avatar answered Nov 15 '22 12:11

David Alejandro Burgos Rodas