사용자가 목록을 스크롤 할 때 도구 모음을 숨기거나 표시하려고합니다. 그것을하기 위해 번역을 사용하고 있지만 actionBar 대신 공백이 나타납니다. 나는 setVisibility (View.GONE)를 사용하는 경우, 빈 공간은 애니메이션 동안 표시하고 추한 인 끝나면 숨 ..Android Toolbar 공백 표시/숨기기
Here is a short video of my issue
을 그리고 여기 내가 구글 I에서 (내 애니메이션을 어떻게 것/O 응용 프로그램) : 여기
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());
}
}
그리고 나의 레이아웃입니다 :
<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>
그리고 내 도구 모음
<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"
/>
이 문제를 해결할 수 있었습니까? – chip