Tôi đang cố hiển thị chế độ xem văn bản ở trên cùng của nút Hành động nổi. Bên FrameLayout, tôi có 1 FAB và 1 TextView:Nút tác vụ nổi luôn hiển thị trên đầu trang
<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>
Theo answer này, tôi đã thêm
android: stateListAnimator = "@ null"
để FAB - không Sự khác biệt. Tôi đã đặt TextView sau FAB - không có hiệu lực.
Làm thế nào để hiển thị một cái nhìn trên đầu trang của FloatingActionButton?
séc http này: //stackoverflow.com/questions/24459352/how-can-i-add-the-new-floating-actio n-button-between-two-widgets-layouts – Stallion
độ cao là một lựa chọn? Tôi không chắc đó là minSdk của bạn – W0rmH0le
Sử dụng RelativeLayout !! cố gắng đặt thuộc tính TextView ** android: layout_above = "@ id/fabAddSeller" ** –