-
<Flutter> BottomNavigationBar 상하 기본 여백 제거하기액티브 스킬/플러터 2022. 7. 6. 21:33728x90
🧭
selectedFontSize
showSelectedLabels 프로퍼티에 false를 입력하면 bottomNavigationBarItem의 라벨을 숨길 수 있지만, 여전히 여백을 차지하고 있습니다.
BottomNavigationBar를 그대로 사용한다면 당장 문제될 것은 없습니다.
다만, BottomNavigationBar의 높이를 변경한다든지 하는 변경을 가할 경우 내부의 아이콘이 범위를 초과하는 에러가 발생할 수 있습니다.
우리는 margin 혹은 padding 값을 준 적이 없기 때문에 당황스러울 수 있습니다.
이 때 selectedFontSize 값을 0으로 주면 해당 에러가 사라지는 것을 확인할 수 있습니다.
📌
https://api.flutter.dev/flutter/material/BottomNavigationBar-class.html
BottomNavigationBar class - material library - Dart API
A material widget that's displayed at the bottom of an app for selecting among a small number of views, typically between three and five. The bottom navigation bar consists of multiple items in the form of text labels, icons, or both, laid out on top of a
api.flutter.dev
728x90'액티브 스킬 > 플러터' 카테고리의 다른 글
<Flutter> ListViewItem 내 버튼을 누르는 경우 특정 위젯 보이기/숨기기 (0) 2022.07.16 <Flutter> font_awesome_flutter 패키지 - 아이콘 팩 (0) 2022.07.13 <Flutter> native_splash 라이브러리로 스플래시 스크린 간단하게 만들기 (0) 2022.07.05 <Flutter> dio / retrofit / freezed (0) 2022.06.29 <Flutter> VS Code에서 CLI로 프로젝트 생성 및 열기 (0) 2022.06.26