2016-07-29 2 views
0

5 월 앱에서 AdMobs 스마트 배너를 사용하고 있습니다. 배너 크기를 제외한 시작하기 Google에서 제안한 모든 것을 수행했습니다. 320x50, screen widthx50입니다. 자동 레이아웃에서는 가로 가운데에 1 개, 화면 너비에 1 개를 추가했습니다. 나는이납니다 GADBannerView도보기 크기를 로그인하는 경우Swift AdMob 광고 크기가 잘못되었습니다

<Google> Unable to set adSize property. Not enough space to show ad with custom size, {600, 50}. Please use a size that fits the current screen bounds of {320, 568}. 
<Google> To get test ads on this device, call: request.testDevices = @[ @"bb3f8f97887" ]; 
<Google> Unable to set adSize property. Not enough space to show ad with custom size, {600, 50}. Please use a size that fits the current screen bounds of {320, 568}. 
<Google> Invalid Request. Ad size will not fit on screen 

은 (아이폰 5에서 실행) :

Size: (0.0, 0.0, 320.0, 50.0) 
나는 시뮬레이터에 내가 잘 작동하지만 장치에 나는이 오류를 받고 있어요 것을 실행하는 경우

@IBOutlet weak var bannerView: GADBannerView! 

bannerView.adUnitID = "ca-app-pub-394/216" 
bannerView.adSize = kGADAdSizeSmartBannerPortrait 
bannerView.rootViewController = self 
print("Size: ",bannerView.bounds) 
bannerView.loadRequest(GADRequest()) 
:

내 코드입니다 691,363,210

이들은

+1

너비에 대한 제약 조건이 없습니다. – TheValyreanGroup

+0

Lol 문제 없습니다. 항상 작은 것들입니다. – TheValyreanGroup

답변

1

당신은 너비 제약 조건을 추가 할 필요가 내 제약을합니다.

Ctrl 키를 누른 상태에서 AdView를 부모로 드래그하고 같음 너비를 선택합니다.