Kullanıcı listeyi kaydırırken araç çubuğumun gizlenmesini veya gösterilmesini sağlamaya çalışıyorum. Bunu yapmak için çeviri kullanıyorum ancak actionBar'ım yerine boş bir alan beliriyor. Bir setVisibility (View.GONE) kullanıyorsanız, boşluk animasyonu sırasında görünür ve çirkin olduğu bitince gizlemek ..Android Araç Çubuğu boş alanı göster/gizle
Here is a short video of my issue
Ve burada ben Google I dan (benim animasyon yaparız olacak G/Ç uygulaması): burada
public void showToolbar(boolean show){
if (show) {
toolbar.animate()
.translationY(0)
.alpha(1)
.setDuration(HEADER_HIDE_ANIM_DURATION)
.setInterpolator(new DecelerateInterpolator());
} else {
toolbar.animate()
.translationY(-toolbar.getBottom())
.alpha(0)
.setDuration(HEADER_HIDE_ANIM_DURATION)
.setInterpolator(new DecelerateInterpolator());
}
}
Ve düzenidir:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mainContent">
<include layout="@layout/toolbar"
android:id="@+id/my_toolbar" />
<fragment
android:name="com.ar.oe.fragments.SectionsFragment"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/actionBarSize"/>
</RelativeLayout>
Ve araç çubuğu
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/my_toolbar"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
/>
bunu düzeltmeyi başardınız mı? – chip