Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 iAd 添加到我的应用程序中。
我在我的 appDelegate 中对其进行了实例化,并希望有一个关闭按钮以允许用户随时关闭广告。
我该怎么做呢?
用户点击广告后,广告将占据屏幕。全屏广告的左上角应该已经有一个关闭图标。它们也可以通过调用横幅视图的 cancelBannerViewAction 以编程方式关闭。
如果您希望用户可以移除小广告,我相信您必须自己实现关闭 (X),方法是在视图中添加一个按钮,将其链接到 IBAction 并调用横幅广告 removeFromSuperview。