Android 有没有办法修复文本上方的泪珠滑块?
我对文本字段中选定文本的滑块有一个奇怪的问题,如下图所示,它只出现在这个屏幕上,而不出现在其他屏幕上 这是文本字段的代码:Android 有没有办法修复文本上方的泪珠滑块?,android,ios,flutter,mobile,flutter-layout,Android,Ios,Flutter,Mobile,Flutter Layout,我对文本字段中选定文本的滑块有一个奇怪的问题,如下图所示,它只出现在这个屏幕上,而不出现在其他屏幕上 这是文本字段的代码: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'Maiden Name :',
style: TextStyle(
fontSize: 16, color: Colors.grey.shade700),
),
Flexible(
child: SizedBox(
width: MediaQuery.of(context).size.width / 2,
height: 30,
child: TextField(
cursorColor: Colors.grey.shade700,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
decoration: new InputDecoration(
hintText:
'As per your official documents',
hintStyle: TextStyle(
color: Colors.grey.shade900,
fontSize: 10,
fontStyle: FontStyle.italic),
isDense: true,
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(),
),
),
controller: familyNameController,
),
),
),
],
我已经找到了解决问题的办法 通过添加
contentPadding: EdgeInsets.symmetric(vertical: 5),
通过删除Flexible widget,将文本字段中的InputDecoration更改为:
Container(
width: MediaQuery.of(context).size.width / 2,
height: 30,
child: TextField(
cursorColor: Colors.grey.shade700,
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 16),
textAlignVertical: TextAlignVertical.center,
decoration: new InputDecoration(
hintText:
'As per your official documents',
hintStyle: TextStyle(
color: Colors.grey.shade900,
fontSize: 10,
fontStyle: FontStyle.italic),
isDense: true,
//focusColor: Colors.black,
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 5),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(),
),
),
controller: surnameController,
),
),