flutter TextField输入超过UI显示的宽度就被裁剪了一半,增加父容器高度可以恢复,但是UI变了
这第一个看起来也没有垂直居中
Container(
color: Color.fromRGBO(240, 244, 247, 1),
height: 65.px,
width: 150.px,
child: TextField(
textAlignVertical: TextAlignVertical.center,
cursorColor: Color.fromRGBO(52, 52, 52, 1.0),
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
controller: _inputHandle,
decoration: InputDecoration(
filled: true,
border: InputBorder.none,
),
style: TextStyle(
color: Color.fromRGBO(0, 0, 0, 1),
fontSize: 34.px,
fontWeight: FontWeight.w600,
),
),
)
还是我写的有问题
###new TextField(
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
style: TextStyle(
fontSize: 36.px,
fontWeight: FontWeight.w700,
color: Color.fromRGBO(0, 0, 0, 1)
),
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(horizontal: 5),
hintText: '1',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(15),
borderSide: BorderSide.none),
fillColor: Color(0xffaaaaaa),
),
)