gpt4 book ai didi

android - Flutter Bottom Navigation Bar 键盘垫两次

转载 作者:IT王子 更新时间:2023-10-29 06:41:47 29 4
gpt4 key购买 nike

BottomNavigationBar 有问题,当键盘抬起时它会增加高度

Before

After focused on TextField

非常感谢对这个问题的洞察力。非常感谢!

代码:

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(),
);
}
}

最佳答案

在我看来,这就像一个已知问题。 https://github.com/flutter/flutter/issues/12084

如果有多个脚手架,则为每个脚手架添加一次填充。

关于android - Flutter Bottom Navigation Bar 键盘垫两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48307629/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com