flutter TextField 详解《边框、高度、背景色、
2019-11-14 本文已影响0人
曾经也是个少年
Expanded(
child:ConstrainedBox(
constraints: BoxConstraints(
maxHeight: 40,
),
child: TextField(
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(10, 0, 10, 15),
fillColor: Color(0XFFFFF8F4),
filled: true,
enabledBorder: OutlineInputBorder(
/*边角*/
borderRadius: BorderRadius.all(
Radius.circular(5), //边角为5
),
borderSide: BorderSide(
color: Colors.white, //边线颜色为白色
width: 1, //边线宽度为2
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.white, //边框颜色为白色
width: 1, //宽度为5
),
borderRadius: BorderRadius.all(
Radius.circular(5), //边角为30
),
),
),
),
),
),