Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
颤振键盘在android中隐藏文本字段,但在iOS中工作正常_Android_Ios_Flutter_Flutter Layout - Fatal编程技术网

颤振键盘在android中隐藏文本字段,但在iOS中工作正常

颤振键盘在android中隐藏文本字段,但在iOS中工作正常,android,ios,flutter,flutter-layout,Android,Ios,Flutter,Flutter Layout,当文本字段被聚焦时,内容在iOS中向上滚动,但在android中不起作用。我是否需要更改小部件的层次结构或AndroidManifest文件中需要更改的一些配置?我还尝试了resizeToAvoidBottomInset和resizeToAvoidBottomPadding脚手架的性能 Widget build(BuildContext context) { return Scaffold( body: Container( margin: EdgeInsets.all(0.0),

当文本字段被聚焦时,内容在iOS中向上滚动,但在android中不起作用。我是否需要更改小部件的层次结构或AndroidManifest文件中需要更改的一些配置?我还尝试了resizeToAvoidBottomInset和resizeToAvoidBottomPadding脚手架的性能

Widget build(BuildContext context) {
return Scaffold(
  body: Container(
    margin: EdgeInsets.all(0.0),
    decoration: BoxDecoration(
      image: DecorationImage(
          image: AssetImage("assets/images/background.png"),
          fit: BoxFit.fill),
    ),
    child: Stack(
      children: <Widget>[
        Center(
          child: Padding(
            padding: const EdgeInsets.symmetric(horizontal: 16.0),
            child: signUpCardView,
          ),
        ),
        userLogin(bloc),
      ],
    ),
  ),
);
小部件构建(构建上下文){
返回脚手架(
主体:容器(
边距:所有边集(0.0),
装饰:盒子装饰(
图像:装饰图像(
图像:AssetImage(“assets/images/background.png”),
适合:BoxFit.填充),
),
子:堆栈(
儿童:[
居中(
孩子:填充(
填充:常量边集。对称(水平:16.0),
孩子:注册卡片视图,
),
),
用户登录(集团),
],
),
),
);
}

小部件获取注册卡视图{
返回SingleChildScrollView(
孩子:卡片(
颜色:颜色,白色,
子:列(
crossAxisAlignment:crossAxisAlignment.start,
mainAxisSize:mainAxisSize.min,
儿童:[
填充物(
填充:边缘设置。对称(垂直:30.0),
儿童:中心(
子:列(
儿童:[
正文(
“${AppTranslations.of(context.text(“注册”)}”,
样式:TextStyle(
颜色:AppColors.BUTTON_SECONDARY_BACKGROUND_color,
fontFamily:customFontFamily,
字体大小:30.0,
),
),
大小盒子(
宽度:50,
身高:20,
孩子:分割器(
厚度:4.0,
颜色:AppColors.BUTTON_SECONDARY_BACKGROUND_color,
),
)
],
),
),
),
填充物(
填充:常量边集。对称(垂直:0.0),
子项:名称字段(集团),
),
填充物(
填充:常量边集。对称(垂直:0.0),
子项:mobileField(集团),
),
填充物(
填充:常量边集。对称(垂直:0.0),
子项:emailField(集团),
),
填充物(
填充:常量边集。对称(垂直:0.0),
子项:passwordField(bloc),
),
confirmPasswordField(集团),
居中(
孩子:填充(
填充:常量边集。对称(垂直:16.0),
子:submitButton(集团),
),
),
填充物(
填充:边缘设置。对称(垂直:8.0),
儿童:中心(
孩子:填充(
填充:仅限常量边设置(底部:50.0),
孩子:排(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
正文(
“${AppTranslations.of(context).text(“alreadyHaveAnAccount”)}”,
样式:TextStyle(
颜色:Colors.grey.shade600,
fontFamily:customFontFamily,
),
),
墨水池(
onTap:(){
_opensignscreen();
},
子:文本(
“${AppTranslations.of(context.text(“signIn”)}”,
样式:TextStyle(
颜色:AppColors.BUTTON_SECONDARY_BACKGROUND_color,
fontFamily:customFontFamily,
),
),
),
],
),
),
),
),
],
),
),
);
}

要使屏幕“调整大小”,即移动到光标,您的android清单中应包含以下内容:

<application
  ...
  <activity
    ...
    android:windowSoftInputMode="adjustResize"

终于解决了我的问题。这是由于styles.xml中的
true

我已经将其设置为android:WindowsOfInputMode=“adjustResize”。我还需要设置其他属性吗?删除true后,它对我不起作用。。。
<application
  ...
  <activity
    ...
    android:windowSoftInputMode="adjustResize"