Próbuję wyświetlić widok tekstowy u góry pływającego przycisku akcji. Wewnątrz FrameLayout, mam 1 Fab i 1 TextView:Ruchomy przycisk akcji zawsze wyświetla się na wierzchu
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|start"
android:padding="@dimen/fab_margin">
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabAddSeller"
android:layout_width="70dp"
android:layout_height="70dp"
app:backgroundTint="#3780f4"
android:stateListAnimator="@null"/>
<TextView
android:id="@+id/tvSellRecordCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/sell_record_counter"
android:layout_gravity="top|end"
android:text="12"
android:textColor="#FFFFFF"
android:textSize="10sp" />
</FrameLayout>
Według tego answer, dodałem
android: stateListAnimator = "@ null"
do FAB - brak różnica. Umieściłem TextView po FAB - bez efektu.
Jak pokazują inny pogląd na górze FloatingActionButton?
sprawdzić ten http: //stackoverflow.com/questions/24459352/how-can-i-add-the-new-floating-actio Układ n-button-between-two-widgets – Stallion
elewacja jest opcją? Nie jestem pewien, który jest twój minSdk – W0rmH0le
Użyj RelativeLayout !! spróbuj ustawić właściwość TextView ** android: layout_above = "@ id/fabAddSeller" ** –