mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-04 15:28:21 +08:00
增加 BottomNavigationBar 选中文字大小说明
This commit is contained in:
@ -36,6 +36,8 @@ class _BottomNavigationBarFullDefault extends State {
|
||||
currentIndex: _currentIndex, // 当前所高亮的按钮index
|
||||
onTap: _onItemTapped, // 点击里面的按钮的回调函数,参数为当前点击的按钮 index
|
||||
fixedColor: Colors.deepPurple, // 如果 type 类型为 fixed,则通过 fixedColor 设置选中 item 的颜色
|
||||
selectedFontSize: 12.0,
|
||||
unselectedFontSize: 12.0,
|
||||
items: <BottomNavigationBarItem> [
|
||||
BottomNavigationBarItem(
|
||||
title: Text("Home"), icon: Icon(Icons.home)),
|
||||
|
@ -25,6 +25,7 @@ const String _text1 =
|
||||
- 它作为 Scaffold.bottomNavigationBar 参数;
|
||||
- BottomNavigationBar 3-5个之间个底部按钮数量是合理的,理论上 icon 大小合适,可以支持更多;
|
||||
- 默认0-3个底部按钮数量时,BottomNavigationBar采用fixed的模式摆放底部按钮,当有4个时默认使用 BottomNavigationBarType.shifting 模式摆放底部按钮;
|
||||
- 大多数人可能不需要选中文字被放大,可以通过 设置 selectedFontSize 与 unselectedFontSize 同等大小覆盖默认效果;
|
||||
- 下面的底部导航即是效果;
|
||||
""";
|
||||
|
||||
|
Reference in New Issue
Block a user