I'm using Android Support `FloatingActionButton` (FAB) and `CoordinatorLayout` and I want anchor FAB to a `CardView`.

This is my code:

```
<android.support.design.widget.CoordinatorLayout
... />

<LinearLayout
  ...>
     <android.support.v7.widget.CardView
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
    ...
</LinearLayout>

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="32dp"
    android:src="@android:drawable/ic_menu_send"
    app:layout_anchor="@id/container"
    app:layout_anchorGravity="bottom|end" />

</android.support.design.widget.CoordinatorLayout>

```

This works but sometimes FAB appear on left-top side of page, not anchored. 

In this case, when I press FAB, it comes back anchored. `CardView` isn't a direct child of `CoordinatorLayout` but [Support Library 24.2.1] that i'm using allows this.

What could be the problem?