Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-16-2011, 10:01 AM   #1 (permalink)
Registered Member
 
mouser58907's Avatar
 
Join Date: Feb 2010
Posts: 188
mouser58907 is on a distinguished road
Default Resizing view leaves black bar - Adwhirl with Tabbar

What I'm doing is animating in the new ad, but it does it even if I don't use animation. First off here is my code.

Code:
	CGSize adSize = [adView actualAdSize];
	CGRect newFrame = adView.frame;
	newFrame.size = adSize;
	newFrame.origin.y = 20;
	newFrame.origin.x = (self.view.bounds.size.width - adSize.width)/ 2;
	adView.frame = newFrame;
	
	CGRect tabFrame = uiTabBarController.view.frame;
	tabFrame.size = CGSizeMake(320, 480-20-adSize.height);
	tabFrame.origin.y = 20+adSize.height;
	uiTabBarController.view.frame = tabFrame;
I used NSLog at the beginning of that block to see what the tabbar controllers frame is, then at the end printed the size/frame of the adbar, and the tabbar after being changed. Here is the output.

Code:
 Tab Bar Controller Frame: {{0, 0}, {320, 480}}
 Ad Size: {320, 50}
 Tab Bar Controller Frame: {{0, 70}, {320, 410}}
 Ad Frame: {{0, 20}, {320, 50}}

 Tab Bar Controller Frame: {{0, 70}, {320, 410}}
 Ad Size: {320, 48}
 Tab Bar Controller Frame: {{0, 68}, {320, 412}}
 Ad Frame: {{0, 20}, {320, 48}}
Looks correct doesn't it? Well what I get is 20px status bar up top, 50px for the ad (if its a 50px ad), then a weird black bar beneath the ad covering up the first row in my tableview. Then underneath is everything as it should be. However if I switch to a different tab and back the bar is gone and everything works as it should.

Here is what it looks like.Click Here

Thanks for your help.
__________________
My Apps:Pee Prank (free)
My Company: Pulsar Productions

If I helped you, download my App or tell a friend! Thanks.
mouser58907 is offline   Reply With Quote
Old 02-16-2011, 03:36 PM   #2 (permalink)
Registered Member
 
mouser58907's Avatar
 
Join Date: Feb 2010
Posts: 188
mouser58907 is on a distinguished road
Default

I should add, it only happens the first time. I initialize the adbar off the screen, and then slide it down when an ad is received. Here is the results of the adbar's frame before and after the ad is recieved.

Code:
Ad Frame Before Animation: {{0, -30}, {320, 50}}
Ad Frame After Animation:     {{0, 20}, {320, 50}}

EDIT - It happens even if I do not initialize it off the screen.
__________________
My Apps:Pee Prank (free)
My Company: Pulsar Productions

If I helped you, download my App or tell a friend! Thanks.

Last edited by mouser58907; 02-16-2011 at 03:39 PM.
mouser58907 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 368
8 members and 360 guests
cpsclicker, Error404, jeroenkeij, Kirkout, PavelMik, teebee74, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:05 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0