gpt4 book ai didi

drop-down-menu - Flutter 下拉按钮文字溢出

转载 作者:IT王子 更新时间:2023-10-29 07:23:33 24 4
gpt4 key购买 nike

我怎样才能使文本扩展到它的内容?我试过了

child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
items: _currentCitySelected.area
.map((String dropDownStringItem) {
return DropdownMenuItem<String>(
value: dropDownStringItem,
child: Container(
child: Text(
dropDownStringItem,
maxLines: 2,
// overflow: TextOverflow.clip,
)),
);
}).toList(),
onChanged: (String newValueSelected) {
setState(() {
this._currentAreaSelected =
newValueSelected;
});
},
value: _currentAreaSelected,
))

[ enter image description here文本扩展为下拉对话框内容中的内容,但它在主视图中的工作方式不同。 enter image description here

最佳答案

DropdownButtonisExpanded 属性设置为 true

isExpanded: true

像那样:

DropdownButtonHideUnderline(
child: DropdownButton<String>(
isExpanded: true,
items: [...]

关于drop-down-menu - Flutter 下拉按钮文字溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54275923/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com