首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >颤振:展开生成的空白

颤振:展开生成的空白
EN

Stack Overflow用户
提问于 2020-06-10 09:30:08
回答 1查看 26关注 0票数 0

我想知道这个差距是如何产生的,尽管它看起来很漂亮。

enter image description here

扩展后的高度看起来是自动设置的。这个高度有什么规律性吗?如何删除

这是一个由cloumn和row组成的表单,文本字段在行中,并由展开的

代码语言:javascript
复制
Column(
        mainAxisSize: MainAxisSize.max,
        children: <Widget>[
          Container(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Image(
                  image: AssetImage("img/phone_icon.png"),
                  width: 36.w,
                  height: 19.h,
                  fit: BoxFit.fill,
                ),
                Text(
                  "+60",
                  style:
                      TextStyle(color: Color(0xff666666), fontSize: 15.sp),
                ),
                Container(
                  margin: EdgeInsets.fromLTRB(15.w, 0, 14.w, 0),
                  alignment: Alignment.center,
                  width: 1.w,
                  height: 12.h,
                  decoration: BoxDecoration(color: Color(0xffCCCCCC)),
                ),
                Expanded(
                  child: TextField(
                    controller: phoneController,
                    style: TextStyle(
                      color: Color(0xff666666),
                      fontSize: 15.sp,
                    ),
                    decoration: InputDecoration(
                        hintText: S.of(context).phoneNumber,
                        hintStyle: TextStyle(
                          color: Color(0xFFCCCCCC),
                        ),
                        border: InputBorder.none),
                    inputFormatters: [
                      WhitelistingTextInputFormatter.digitsOnly,
                      LengthLimitingTextInputFormatter(10)
                    ],
                    keyboardType: TextInputType.number,
                    textInputAction: TextInputAction.next,
                    cursorColor: Color(0xFF1FA2FF),
                  ),
                )
              ],
            ),
          )
         ......
EN

回答 1

Stack Overflow用户

发布于 2020-06-10 10:05:29

您可以在输入修饰中使用contentPadding来调整TextField输入的高度

代码语言:javascript
复制
....
TextField(
    InputDecoration(
            hintText: "Search users",
            contentPadding: EdgeInsets.symmetric(
              vertical: 15.0,
        )
)
....

Flutter Docs

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62294458

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档