简体   繁体   English

如何删除 DropdownButton 中的高程?

[英]How to remove the elevation in DropdownButton?

help me to remove this elevation in DropdownButton, I tried using elevation = 0 , but nothing happened or if you have better widget to display item like DropdownButton please show me.帮我删除 DropdownButton 中的这个高度,我尝试使用elevation = 0 ,但什么也没发生,或者如果你有更好的小部件来显示像 DropdownButton 这样的项目,请告诉我。

在此处输入图片说明

thank you谢谢

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM