[Android] FloatingActionButton, BottomAppBar

Doodung·2021년 8월 27일
0

Android

목록 보기
4/9
post-thumbnail

FloatingActionButton, BottomAppBar

  1. Build.gradle에 material 추가
    'com.google.android.material : material : 최신버전’

  2. BottomAppBar 스타일이
    Theme.MaterialComponents 테마를 상속해야함

  3. BottomAppBar는 CoordinatorLayout의 자식이어야함


FAB(FloatingActionButton)의 app : layout_anchor 속성에서 BottomAppBar의 ID를 지정하여 FAB를 BottomAppBar에 고정 할 수 있다.

  • BottomAppBar 속성

fabAlignmentMode : fab 위치 지정
fabAttached : 속해있냐 떨어져있냐
fabCradleDiameter : Fab를 포함하는 직경
fabCradleRoundedCornerRadius : 곡선 반경 지정
fabCradleVerticalOffset : 하단에서 오프셋 지정


구현 화면

profile
반가워요!

0개의 댓글