我想增加CupertinoNavigationBar身高。代码是这样的:
child: CustomCupertinoNavigationBar(
padding: EdgeInsetsDirectional.zero,
backgroundColor: Colors.white,
middle: Semantics(
label: "dashboard-main-page-title",
child: Text(
"My Title",
style: TextStyles.HankenSans_Bold_18_PrimaryBlack,
key: Key('dashboard-main-page-title'),
),
),
leading: Semantics(
label: "dashboard-back-button",
child: Material(
color: Colors.white,
child: CustomBackButton(
onPressHandler: () {
Navigation().openMyAccountPage();
},
),
),
),
);
Run Code Online (Sandbox Code Playgroud)
我尝试创建自己的定制库比蒂诺。我复制 cupertino/nav_bar.dart 并更改了_kNavBarPersistentHeight参数,const double _kNavBarPersistentHeight = 58.0;但它导致 IOS 中出现两个导航栏。有人能帮我解决这个问题吗?非常感激。
我目前正在开发一个需要使用 Cupertino 小部件构建的项目。一切都很好,直到我尝试不在下一页显示底部导航栏,但底部导航栏仍然从上一页向前推进。下面是我的示例代码。
class PageOne extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoTabScaffold(
tabBar: CupertinoTabBar(
items: [
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.person), label: 'Person'),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.mail), label: 'Mail'),
BottomNavigationBarItem(
icon: Icon(CupertinoIcons.flag), label: 'Flag'),
],
),
tabBuilder: (context, index) {
return CupertinoTabView(
routes: {
'p2': (context) => PageTwo(),
},
builder: (context) {
return CupertinoPageScaffold(
backgroundColor: Colors.white,
child: Center(
child: Column(
children: [
ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, 'p2');
},
child: Text('Next Page'),
),
],
),
));
},
);
},
); …Run Code Online (Sandbox Code Playgroud)