아래쪽 탐색 모음과 FAB를 겹치려고합니다. 내 내비게이션 바는 다음과 같이 할 :아래쪽 탐색 모음 안에 FAB이 잘리지 않도록하십시오.
을하지만 그 대신 그것과 같이 버튼을 차단 :
가 어떻게이 FAB 방지 할 차단되는? 여기 내 XML는 다음과 같습니다
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mobgen.designsprintapp.ui.main.MainActivity">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="?android:attr/windowBackground"
android:backgroundTint="@color/colorPrimary"
app:itemBackground="@color/colorPrimary"
app:itemIconTint="@color/nav_item_color_state"
app:itemTextColor="@android:color/black"
app:menu="@menu/navigation" >
<android.support.design.widget.FloatingActionButton
android:id="@+id/tools"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
android:elevation="6dp"
android:scaleType="center"
app:srcCompat="@drawable/play" />
</android.support.design.widget.BottomNavigationView>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
정말 중요하지 않지만 FAB을 하단 탐색보기의 테두리 안에 완전히 넣고 싶지는 않지만 이미지에서 볼 수있는 것처럼 상단이 약간 겹쳐져 있어야합니다. – Tim
@Tim, 이것이 귀하의 요구 사항이라면,'BottomNavigationView '에 ['android : clipChildren = "false"'] (https://developer.android.com/reference/android/view/ViewGroup.html#attr_android:clipChildren) '. – azizbekian
linearlayout에 android : clipChildren = "false"를 적용해야했습니다. – Tim