且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调整iAd横幅视图的大小

更新时间:2023-02-01 14:14:16

无需设置ADBannerView的大小.您的ADBannerView将知道它在哪个设备上并正确设置其尺寸.您需要做的只是设置ADBannerView的位置.查看此实现作为示例.

There's no need to set the ADBannerView's size. Your ADBannerView will know which device it is on and set the dimensions of itself correctly. All you need to do is set the ADBannerView's position. Check this implementation for an example.

如果您使用的是自动版式,并且希望ADBannerView位于屏幕底部,请使用Bottom Space to: Bottom Layout Guide将其固定在屏幕底部,并将其与Align Center X to: Superview对齐.确保您不要设置任何高度,宽度,尾随或前导约束

If you're using Auto Layout and wanted the ADBannerView to be at the bottom of the screen then pin it to the bottom of the screen with Bottom Space to: Bottom Layout Guide and align it to Align Center X to: Superview. Be sure you do not set any height, width, trailing, or leading constraints