Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios7 将iAd添加到谷歌地图1.7_Ios7_Iad_Google Maps Sdk Ios - Fatal编程技术网

Ios7 将iAd添加到谷歌地图1.7

Ios7 将iAd添加到谷歌地图1.7,ios7,iad,google-maps-sdk-ios,Ios7,Iad,Google Maps Sdk Ios,我想在谷歌地图上临时显示一个广告横幅 因此,我有以下代码: wpmappviewcontroller.h: #import <iAd/iAd.h> .... @interface WPMapViewController : UIViewController<ADBannerViewDelegate, GMSMapViewDelegate> 我猜是因为self.view=mapView将覆盖_bannerView.delegate。运行此代码时,我可以看到广告横幅,但无法

我想在谷歌地图上临时显示一个广告横幅

因此,我有以下代码:

wpmappviewcontroller.h:

#import <iAd/iAd.h>
....
@interface WPMapViewController : UIViewController<ADBannerViewDelegate, GMSMapViewDelegate>
我猜是因为self.view=mapView将覆盖_bannerView.delegate。运行此代码时,我可以看到广告横幅,但无法单击它。
当我注释时
self.view=mapView输出横幅按预期工作,但我看不到地图

self.candisplaybanerads=YES不是我的选项,因为它会缩小地图


将iAd横幅添加到此UIViewController的正确方法是什么?

我通过更改

mapView_=[GMSMapView mapWithFrame:CGRectZero摄像机:摄像机]

mapView_=[GMSMapView mapWithFrame:self.view.frame相机:相机]


然后显示地图和iAd标题,标题位于屏幕底部。

这可能是因为子视图继承了superview的交互属性?您是否尝试过设置self.view.userInteractionEnabled=YES;看看这是否能让横幅视图得到触动?我是第一个尝试这个的人吗?或者您需要更多信息吗?关于嵌入表视图,我也遇到了类似的问题。表格视图检测触摸,但不滚动。这似乎是在1.7更新之后发生的。谢谢,但仍然不是clickable@AlexanderScholz,也许您应该尝试在DeveloperCenter/iTunesConnect中添加一个应用程序,然后将Xcode项目链接到此应用程序。
@implementation WPMapViewController {

    GMSMapView *mapView_;
    ADBannerView *_bannerView;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        // On iOS 6 ADBannerView introduces a new initializer, use it when available.
        if ([ADBannerView instancesRespondToSelector:@selector(initWithAdType:)]) {
            _bannerView = [[ADBannerView alloc] initWithAdType:ADAdTypeBanner];
        } else {
            _bannerView = [[ADBannerView alloc] init];
        }
        _bannerView.delegate = self;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    screenSize = [[UIScreen mainScreen] bounds].size;

    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:51.7
                                                        longitude:10.4
                                                             zoom:5.3];
    mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];

    self.view = mapView_;

    mapView_.delegate = self;

    _bannerView.frame = CGRectMake(0, screenSize.height - 50, 320, 50);
    [self.view addSubview:_bannerView];
}