2013-06-25 2 views
3

내 배너 크기를 320 * 50으로 설정했습니다. Retina 디스플레이의 경우 640 * 100으로 설정했습니다. 배너를 전혀 표시하지 않습니다. 내가 실수 한 것을 알려주시겠습니까? 크기가 320 * 50 일 때 작동하지만 640 * 100이 아닌 경우 작동합니다.AdMob 배너 망막 디스플레이 용 크기

답변

3

망막 장치에도 320x50을 사용하십시오. 광고 네트워크의 책임은 기기를 두 배나 크게 만드는 책임이 아니라 기기에 맞춰 2 배 밀도 이미지로 돌아 오는 것입니다.

5

예, 레티 나 기기에서 동일한 크기를 사용합니다.

그러나 특정 크기를 설정하면 안됩니다. 앱을 iPad로 변환하기로 결정했다면 광고 코드가 갑자기 멈추게되어 화면 전체가 절반으로 늘어납니다.

스마트 배너 크기를 사용하면 Admob에서 모든 작업을 수행합니다. 예를 들어, 화면 하단에 배너를 배치하는 내 앱 중 하나의 코드가 있습니다. 특히 kGADAdSizeSmartBannerPortrait를 사용하면 광고 배너 크기를 조정할 수 있습니다.

//Admob 

// Available AdSize constants are explained in GADAdSize.h. 
GADBannerView *bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait]; 
bannerView_.rootViewController = self; 
bannerView_.adUnitID = @"ca-app-pub-xxxxxxxxx/xxxx"; 

// Position the ad at the bottom of screen. 
// By default it would be postitioned at (0,0) 
bannerView_.frame = CGRectMake(0, 
           self.view.frame.size.height - bannerView_.frame.size.height, 
           bannerView_.frame.size.width, 
           bannerView_.frame.size.height); 

bannerView_.autoresizingMask = 
UIViewAutoresizingFlexibleLeftMargin | 
UIViewAutoresizingFlexibleTopMargin | 
UIViewAutoresizingFlexibleWidth | 
UIViewAutoresizingFlexibleRightMargin; 

[self.view addSubview:bannerView_]; 

// Initiate a generic request to load it with an ad. 
GADRequest *request = [GADRequest request]; 
request.testDevices = [NSArray arrayWithObjects: 
         GAD_SIMULATOR_ID, 
         nil]; 
[bannerView_ loadRequest:request];