[英]What's the name of flutter widget that has icons bellow the screen?
屏幕下方有圖標的 Flutter 小部件的名稱是什么,我可以左右滑動以在這些屏幕之間切換(例如:Twitter 主頁)
我可以創建一個帶有Row
和Icons
的Container
並手動執行此操作,但我懷疑 Flutter 上已經存在此小部件。
這個底部導航欄可以使用BottomNavigationBar
在你的Scaffold
的bottomNavigationBar
屬性中完成:
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(
icon: Icon(Icons.business), label: 'Business'),
BottomNavigationBarItem(icon: Icon(Icons.school), label: 'School'),
],
),
對於可滑動頁面,可以使用PageView
小部件來完成:
PageView(
children: <Widget>[
ScreenOne(),
ScreenTwo(),
ScreenThree(),
],
);
當您單擊BottomNavigationBar
中的項目時,您可以鏈接它們,它將導航到帶有PageController
的特定頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.