내 프로젝트 중 하나는 일반적인 동작 클래스를 사용하여 완벽하게 작동하는 fab 버튼을 숨기거나 표시하는 것입니다. 이제는 레이아웃 요구 사항을 변경해야합니다. 스크롤 업의 show fab은 작동하지 않습니다.FloatingActionButton은 FrameLayout 내의 RecyclerView와 관련된 문제를 인식합니다.
CoordinatorLayout 설정은 표준이며 그 안에 조각을로드하는 ViewPager가 포함되어 있습니다. Fragment 레이아웃을 변경하여 fab show 동작이 더 이상 올바르게 작동하지 않게되었습니다.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/emptyStateView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:translationY="@dimen/home_empty_state_y_offset">
<ImageView
android:id="@+id/emptyStateImage"
android:layout_width="wrap_content"
android:layout_height="160dp"
android:layout_centerInParent="true"
android:src="@drawable/home_empty_state_animation" />
</RelativeLayout>
<SwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/filterMenu"
android:clipToPadding="false" />
</SwipeRefreshLayout>
</FrameLayout>
그것은처럼 보인다 : 여기
<SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/filterMenu"
android:clipToPadding="false" />
</SwipeRefreshLayout>
이 작동하지 않는 새로운 조각 레이아웃입니다 : 여기
은 원래 작업 조각 레이아웃입니다 추가 된 FrameLayout이 이러한 문제를 일으키고 있지만 왜 그럴까? 이것은 설계상의 문제입니까? 또는 나는 무엇인가 놓치고 있냐?
미친 문제 ... 공유해 주셔서 감사합니다! –