【发布时间】:2018-01-17 18:22:58
【问题描述】:
BottomNavigationBar 出现问题,当键盘向上时它的高度会增加
非常感谢您对此问题的见解。非常感谢!
代码:
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return new Scaffold(
bottomNavigationBar: new BottomNavigationBar(
items: <BottomNavigationBarItem>[
new BottomNavigationBarItem(icon: new Icon(Icons.all_inclusive), title: new Text("Hello"), backgroundColor: Colors.cyan),
new BottomNavigationBarItem(icon: new Icon(Icons.home), title: new Text("Hello"), backgroundColor: Colors.lightGreen),
],
),
appBar: new AppBar(
title: new Text(widget.title),
),
body: new TextField(),
);
}
}
【问题讨论】:
标签: android flutter bottomnavigationview