[英]How to remove the elevation in DropdownButton?
To remove the underline we should wrap the DropdownButton
widget with the DropdownButtonHideUnderline
widget.要删除我们应该包裹下划线DropdownButton
窗口小部件与DropdownButtonHideUnderline
小部件。
The elevation
property will make the drop-down layer elevated when it's in the open state.当下拉层处于打开状态时, elevation
属性将使下拉层升高。
Example例子
DropdownButtonHideUnderline(
child: DropdownButton(
style: TextStyle(color: Colors.black),
items: <String>[
'Android',
'IOS',
'Flutter',
'Python',
].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
hint: Text(
"Please choose a langauage",
style: TextStyle(
color: Colors.black,
fontSize: 16,
fontWeight: FontWeight.w600),
),
onChanged: (value) {
print(value);
},
),
),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.