SnackBar vs FloatActionButton

پرسیده شده
فعالیت 1168 روز پیش
دیده شده 571 بار
0

سلام و عرض ادب . با اینکه روت فایل من coordinator هست ولی اسنک بار روی FloatActionButton میاد و هیچ انیمیشن هم که به بالا دکمه رو انتقال بده اجرا نمیشه.’

فایل پیوست

mohammadjavad khoshneshin
mohammadjavad khoshneshin

3 اسفند 99

0
حذف شده

سلام وقت بخیر

 

اتربیوت app:layout_behavior رو به اشتباه به FloatActionButton اضافه کردید.

فایل تصحیح شده پیوست شد.

app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
فایل پیوست

پوریا شفیعی

توسط

پوریا شفیعی

3 اسفند 99

حذف شده
اون که یه رفتار نسبت به اپ بار میده... زمانی که اسکرول میشه باتن میره پنهان میشه...
mohammadjavad khoshneshin

3 اسفند 99

حذف شده
آهان ، بی دقتی کردم فکر کردم behavior مربوط به scrollview هست بخاطر همین دقیق نخوندم ، پروژتون رو آپلود کنین (میتونین از سایت پیکوفایل) آپلود کنین و لینک رو قرار بدین تا موارد رو بررسی کنم
پوریا شفیعی

4 اسفند 99

حذف شده
پوریا جان کاری که گفتی رو انجام دادم درست شد . سوالی که هست اینه چطور هم انیمیشن بیاد و هم وقتی اسکرول می کنم باتن پنهان بشه
mohammadjavad khoshneshin

4 اسفند 99

حذف شده
محمد جواد جان در سرفصل های اینده با این موارد اشنا میشید.
پوریا شفیعی

4 اسفند 99

0
حذف شده
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">


    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <androidx.appcompat.widget.Toolbar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways"
            app:title="Android Expert"
            app:titleTextColor="@android:color/white"/>

    </com.google.android.material.appbar.AppBarLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>
            <include layout="@layout/item_text"/>

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab_main"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:srcCompat = "@drawable/layer_vector_ic"
        android:layout_gravity="bottom|end"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="20dp"
        tools:ignore="VectorDrawableCompat"
        app:tint="@android:color/white"
        app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
        app:fabSize="auto"
        app:rippleColor="#8AFFFFFF"
        />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
فایل پیوست

mohammadjavad khoshneshin

توسط

mohammadjavad khoshneshin

3 اسفند 99