adriankroeger
adriankroeger

Reputation: 61

android - FloatingActionButton not showing on API 16

I am using a FloatingActionButton in my Layout:

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="61dp"
    android:clickable="true"
    app:fabSize="mini"
    android:src="@android:drawable/btn_star_big_off"
    android:id="@+id/floatingActionButton"
    app:layout_anchor="@+id/container"
    app:layout_anchorGravity="bottom|right"
    android:layout_gravity="start"
    android:layout_marginBottom="20dp"
    android:layout_marginEnd="20dp"
    android:layout_marginRight="20dp"
    app:backgroundTint="@color/colorAccent"
    />

I put an Image in it when the Activity is created:

favbtn = (FloatingActionButton) findViewById(R.id.floatingActionButton);
favbtn.setImageDrawable(ContextCompat.getDrawable(getApplicationContext(), btn_star_big_on));

When testing on an older Device, such as API 16, the Button is not showing/not visible. Is there a way to fix this?

Upvotes: 2

Views: 908

Answers (1)

adriankroeger
adriankroeger

Reputation: 61

Fixed it with favbtn.bringToFront()

Upvotes: 2

Related Questions