Stack Overflow em Português Asked on January 2, 2022
Já vi vários videos no youtube sobre isso mas no meu código não funciona como no video.
Já olhei algumas perguntas e alguns sujerem usar o código abaixo, mas não resolve o problema.
Scaffold(
body: SingleChildScrollView(...),
...
Já tentei usar ListView
mas sempre tenho o mesmo resultado.
O gif abaixo ilustra o que ocorre: Ao abrir o teclado o layout não move pra cima mostrando o campo de texto.
Tentei usar FocusNode
no TextField
mas tbm não funciona.
Meu código é esse.
var itemlBorder = OutlineInputBorder(borderSide: BorderSide(color: MyTheme.tintColor()));
return Scaffold(
appBar: AppBar(title: Text('PageTitle')),
body: SingleChildScrollView(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Column(children: [
//Titulo
Container(
height: 50,
margin: EdgeInsets.only(top: 10),
padding: EdgeInsets.only(left: 10, right: 10, top: 7),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5)),
color: MyTheme.tintColor()
),
child: TextField(
textInputAction: TextInputAction.next,
controller: _cTitulo,
keyboardType: TextInputType.name,
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(12, 0, 12, 0),
enabledBorder: itemlBorder,
focusedBorder: itemlBorder,
labelText: 'Titulo'.toUpperCase(),
),
),
),
//Anexo
Container(...
...
]
)
)
Consegui resolver este problema.
O problema não está no código e sim no AndroidManifest.xml
.
Apenas adicionei android:windowSoftInputMode="adjustResize"
na tag activity
Answered by Jonas Ferreira on January 2, 2022
1 Asked on September 8, 2020 by joel-messias-do-nascimento
3 Asked on September 7, 2020 by i_like_trains
4 Asked on September 5, 2020 by matheus-miranda
0 Asked on September 5, 2020 by user190650
1 Asked on September 3, 2020 by diego-estacho
1 Asked on August 29, 2020 by paulo-lima
0 Asked on August 28, 2020 by anderson-amorim
2 Asked on August 25, 2020 by user196053
1 Asked on August 24, 2020 by anderson-leandro
0 Asked on August 21, 2020 by wesley-souza
1 Asked on August 20, 2020 by joao-vitor-franco
0 Asked on August 15, 2020 by lucio-carlos-resende
2 Asked on August 11, 2020 by barbetta
orientacao a objetos paradigmas programacao funcional terminologia
1 Asked on August 10, 2020 by dba-jr
2 Asked on August 7, 2020 by pedro-bernardo
0 Asked on August 7, 2020 by leandro-gonalves
1 Asked on August 6, 2020 by eliseu-b
2 Asked on August 6, 2020 by marcelo-ferreira-vasconcelos
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP