gpt4 book ai didi

flutter - 为什么 PopupMenuButton 下拉菜单与 statusBar 重叠?

转载 作者:行者123 更新时间:2023-12-03 22:31:27 25 4
gpt4 key购买 nike

当我为 PopupMenuButton 设置 initialValue 时,下拉菜单与状态栏重叠。我怎样才能避免这种情况?另外,如何在应用栏下方设置 PopupMenuButton 的下拉位置?

enter image description here

最佳答案

您可以尝试添加以下内容:

  Widget getMessageText(double parentHeight, double parentWidth) {
return Padding(
padding: EdgeInsets.only(right:parentWidth*0.06),
child: Column(
children: <Widget>[
GestureDetector(
onTap: (){
Navigator.pop(context);

},
child: Padding(
padding: EdgeInsets.only(top: parentHeight*0.02,left: parentWidth*.03),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Text(
"All Posts",
style: CommonWidget.getHelveticaBoldTextStyle(
textFont, Colors.black.withOpacity(0.7)),
textScaleFactor: 1.1,
// textAlign: TextAlign.center,
),
],
),
),
),
GestureDetector(
onTap: (){
Navigator.pop(context);


},
child: Padding(
padding: EdgeInsets.only(top: parentHeight*0.03,left: parentWidth*.03),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
"Posts",
style: CommonWidget.getHelveticaBoldTextStyle(
textFont, Colors.black.withOpacity(0.7)),
textScaleFactor: 1.1,
// textAlign: TextAlign.center,
),
],
),
),
),
GestureDetector(
onTap: (){

Navigator.pop(context);

},
child: Padding(
padding: EdgeInsets.only(top: parentHeight*0.03,left: parentWidth*.03),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
"Complaints",
style: CommonWidget.getHelveticaBoldTextStyle(
textFont, Colors.black.withOpacity(0.7)),
textScaleFactor: 1.1,
// textAlign: TextAlign.center,
),
],
),
),
)
],
),
);



}

关于flutter - 为什么 PopupMenuButton 下拉菜单与 statusBar 重叠?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51225668/

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