当键盘弹出UITextfield放置在键盘上时,我正试图将视图向上移动UIScrollView.我使用的是UIKeyboardWillShowNotification与UIKeyboardWillHideNotification此.
当iOS Keyboard我使用高度的地方时,它工作得很好297.
我的客户正在使用Gboard keyboard,他抱怨说观点不动.当我测试时,我的键盘高度为44.
我已经试过这两个键UIKeyboardFrameBeginUserInfoKey和UIKeyboardFrameEndUserInfoKey为NSNotifiction userInfo对象.两者44都只给予.
我试着用UIKeyboardDidShowNotification和UIKeyboardDidHideNotification也,还是同样的问题.
任何人都可以帮我这个..?
onTap 它打印值,但 setState 在 UI 中没有任何区别,我在有状态小部件和内部构建中也使用它,我无法得到我犯错误的地方,并且我使用 flutter beta。
Widget build(BuildContext context) {
String text = "HEY";
void bb(){
print('Clicked Clicked');
setState(() {
text = "HEY2";
});
}
return Scaffold(
body: Container(
decoration: BoxDecoration(
image: DecorationImage(image: new AssetImage("assets/floor.jpg"), fit: BoxFit.cover,),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(
child: Text(
'HELLO, WORLD!',
style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
textScaleFactor: 6,),
),
Divider(height: 80),
GestureDetector(
onTap: (){
bb();
},
child: Text(text, style: TextStyle(color: Colors.red)),
),
],),
)
);
Run Code Online (Sandbox Code Playgroud)
}