When I select a Textfield the keyboard moves over it

后端 未结 10 698
渐次进展
渐次进展 2020-12-03 05:51

When i select a Textfield, the keyboard is going to be shown but the keyboard hide my selected TextField. Does someone have a solution?

10条回答
  •  执笔经年
    2020-12-03 06:44

    My way here

    Scaffold(
        resizeToAvoidBottomInset: false,
        resizeToAvoidBottomPadding: false,
        body: Container(
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: AssetImage('images/Bg img.png'), fit: BoxFit.fill)),
          child: Padding(
            padding: EdgeInsets.only(
                bottom: MediaQuery.of(context).viewInsets.bottom),
            child: CustomScrollView(
              slivers: [
                SliverFillRemaining(
                  hasScrollBody: false,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                    .............
    

    This template has some advantages:

    • Move content up when the keyboard appears
    • Column using spaceBetween inside a scroll view
    • Background is sticked phone scren and never change event the keyboard ups

提交回复
热议问题