当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How do I put admobs into xcode 4.6 over a scrollview

问题描述:

I have been looking for an answer to this question on google and other places, but have not found a helpful answer as of yet.

I am making an app on Xcode 4.6 using storyboards. I am using a View Controller with a Scroll View inside it and images and text inside the Scroll View.

I have managed to display admob ads put these only appear at the top of the page and go away as I scroll down the page, as the ads are pinned to the top.

I have managed to achieve a scrollable page where the ad stays at the bottom of the page on Android, but not in xcode. I have tried to edit the banner view in the .m file but this has only moved the ad banner down, towards the middle etc.

For example, this is website shows what I am trying to achieve -

http://googleadsdeveloper.blogspot.co.uk/2011/12/incorporating-android-admob-ads-into.html

I would like to achieve the same thing in iOS, Xcode 4.6, so that my apps are consistent throughout the two operating systems.

Thanks in advance.

网友答案:

Don't put the AdMob View inside the scrollview.

  1. Move the bottom edge of your scrollview up so that the banner has enough space.
  2. Place the banner underneath the scrollview. Make sure that banner and scrollview share the same super view (red arrow)
  3. Adjust the autoresizing mask so the banner stays at the bottom. (blue arrow)
    • activate the "allow horizontal resizing" arrow too. I forgot to do this for the screenshot

分享给朋友:
您可能感兴趣的文章:
随机阅读: