天天看點

flutter 去掉Appbar底部陰影以及彈出軟鍵盤擠壓控件小記

  1. 去掉AppBar下面的陰影
appBar: new AppBar(title: new Text('編輯個人資訊',style: AppStyles.AppbarStyle),elevation: 0,),
           

加上這個屬性即可:

elevation: 0,

想對appbar有個深入了解,翻閱Flutter之Appbar解析以及案例展示

  1. 避免軟鍵盤彈出把控件頂上去
@override
  Widget build(BuildContext context) {
      return new Scaffold(
      appBar: new AppBar(title: new Text(IntlUtil.getString(context, Ids.titleEditInfo)),elevation: 0,centerTitle: true,),
        resizeToAvoidBottomPadding: false,//避免軟鍵盤把widget頂上去
        body:Column(
        ......
           

注意:添加

resizeToAvoidBottomPadding: false,

即可