사용자 지정 아래쪽 탐색 보기

중요

이 문서에서 설명하는 기능 및 지침은 공개 미리 보기 상태이며 일반적으로 공급되기 전에 대대적으로 수정될 수 있습니다. Microsoft는 여기에 제공된 정보에 대해 명시적 또는 묵시적 보증을 하지 않습니다.

BottomNavigationView는 접기 기능을 감지하고 해당 자식 보기를 왼쪽 또는 오른쪽에 배치할 수 있는 BottomNavigationView입니다.

displayPosition - 보기가 렌더링되는 화면을 결정합니다. 다음 세 가지 값 중 하나입니다.

  • DisplayPosition.START - 접기 기능의 왼쪽에 그룹화됩니다. START: tabs on the first screen

  • DisplayPosition.END - 접기 기능의 오른쪽에 그룹화됩니다. END: tabs on the first screen

  • DisplayPosition.DUAL - 전체 화면에 걸쳐 있습니다(힌지 아래에 나타날 수 있음). DUAL: tabs on the first screen

bottomNavigationView.displayPosition = DisplayPosition.START

app:display_position 특성을 사용하여 같은 결과를 얻을 수 있습니다.

<com.microsoft.device.dualscreen.bottomnavigation.BottomNavigationView
    android:id="@+id/nav_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:menu="@menu/bottom_nav_menu"
    tool:tools_application_mode="dual_screen"
    .....
    app:display_position="start"
     />

arrangeButtons - 애플리케이션이 접기 기능 위에 걸쳐 있고, 구성 요소에 홀수 개수의 단추가 있는 경우 중간 단추는 힌지로 덮입니다(디바이스에 물리적 힌지가 있는 경우). 이를 방지하는 한 가지 방법은 각 화면에서 단추를 다르게 정렬하는 것입니다.

The buttons can be arranged in different ways on the two screens

bottomNavigationView.arrangeButtons(3, 2)

useTransparentBackground - 애플리케이션이 화면의 전체 너비에 걸쳐 있고, 구성 요소의 일부에 단추가 없는 경우 화면의 해당 부분에 있는 배경을 투명하게 만들 수 있습니다.

The background on the first screen is transparent

bottomNavigationView.useTransparentBackground = true

useAnimation - 단추 배열이 변경될 때 애니메이션을 사용할지 여부를 결정합니다. 기본적으로 AccelerateDecelerateInterpolator가 사용됩니다. animationInterpolator 속성으로 다른 보간을 변경할 수 있습니다.

bottomNavigationView.useAnimation = true
bottomNavigationView.animationInterpolator = OvershootInterpolator()

allowFlingGesture - true로 설정되면 구성 요소에서 플링 제스처를 사용하여 displayPosition을 DisplayPosition.START 또는 DisplayPosition.END로 설정할 수 있습니다.

bottomNavigationView.allowFlingGesture = true