底部溢出30px [英] Bottom overflow by 30px

查看:82
本文介绍了底部溢出30px的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用new Expanded()包装TextField遇到问题.当尝试在textfield中搜索某些内容时,它会向我显示30px的底部溢出.下面是我的代码:

I face a problem by wrapping TextField with new Expanded(). When try to search something in textfield its show me bottom overflow by 30px. Below is my code:

 Widget build(BuildContext context) {
    return new Scaffold(
        body:
      Column(
        children: <Widget>[
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              IconButton(icon: Icon(Icons.search), onPressed: () {
                setState(() {

                });
              }),
              new Flexible(
                child: new TextField(
                  onChanged: (String value) {
                    onchange(value);
                  },
                  maxLines: 1,
                  autocorrect: true,
//                  decoration: const InputDecoration(helperText: "Search"),
                  style: new TextStyle(fontSize: 10.0, color: Colors.black),
                ),
              ),
              _text != null ? IconButton(
                  icon: Icon(Icons.close), onPressed: (){
              }) : new Container(),

              IconButton(icon: Icon(Icons.bookmark_border), onPressed: () {}),
            ],
          ),
          new Expanded(
              child: FilstList(searchtext: _text,)
          ),


        ],
      ),
    );
  }
}

推荐答案

两个解决方案.

  1. resizeToAvoidBottomPadding: false添加到您的Scaffold

Scaffold(
 resizeToAvoidBottomPadding: false,
 body: ...)

  • FilstList(searchtext: _text,)放入scrollableView内(例如SingleChildScrollViewListView)
  • Put your FilstList(searchtext: _text,) inside a scrollableView (like SingleChildScrollView or ListView)
  • 这篇关于底部溢出30px的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆