在Flutter中关闭键盘后,如何将Firebase Admob放在底部? [英] How to position Firebase Admob on the bottom after keyboard is closed in Flutter?
本文介绍了在Flutter中关闭键盘后,如何将Firebase Admob放在底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用firebase_admob软件包.我使用以下代码并设法使Admob标语显示在键盘顶部.
I am using firebase_admob package. I use the following code and manage to make the Admob banner show on top of keyboard.
@override
Widget build(BuildContext context) {
myBanner.show(
anchorOffset: MediaQuery.of(context).viewInsets.bottom, anchorType: AnchorType.bottom)
);
return Scaffold(
//Other codes
);
}
但是,关闭键盘时,标语不会移到底部.该如何解决?
However, when the keyboard is closed, the banner won't move to bottom. How to solve this?
推荐答案
Problem solved by using [admob_flutter]
package which can simply add the banner as a widget and we can position it anywhere we want.
AdmobBanner(
adUnitId: getBannerAdUnitId(),
adSize: AdmobBannerSize.BANNER,
)
这篇关于在Flutter中关闭键盘后,如何将Firebase Admob放在底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文