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 03-14-2011, 05:57 PM   #1 (permalink)
Andrew
 
Join Date: Mar 2011
Location: Minneapolis, MN
Posts: 2
akandels is on a distinguished road
Default UITabBarController: Hard to Click Tab Items

I'm having a really strange issue with my application that uses the UITabBarController.

First, I'm creating the tab bar programmatically and not using NIBs, ala:

Code:
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *localControllersArray = [[NSMutableArray alloc] initWithCapacity: 3];
UINavigationController *nav;

VisitViewController *viewVisit = [[VisitViewController alloc] initWithTabBar];
nav = [[UINavigationController alloc] initWithRootViewController: viewVisit];
[localControllersArray addObject:nav];
[nav release];
[viewVisit release];

// ... other tabs, same format as previous

tabBarController.viewControllers = localControllersArray;
[localControllersArray release];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
One other thing to note, is that in each view controller I'm adding, I'm calling "self.title = 'Tab Title';" to set the title text. I doubt that matters though.

Anyway, everything runs and displays fine -- the problem I'm having is that if I click on the bottom half of the tab image nothing happens. I have to click above the 50% mark to get the tab item to select and change the tabs.

If you look at tab bar applications, there's sort of a natural gradient break right down the middle horizontally. Basically anything below that line, I can't click to switch tabs. It's really annoying because on a device it makes you click the tab over and over until you get above that mark, and it feels very sluggish. On other tab apps like Twitter it works perfectly.

Any ideas?
akandels is offline   Reply With Quote
Old 03-14-2011, 06:13 PM   #2 (permalink)
Andrew
 
Join Date: Mar 2011
Location: Minneapolis, MN
Posts: 2
akandels is on a distinguished road
Default Fixed

I figured it out. I was using:

Code:
CGRect screenRect = [[UIScreen mainScreen] applicationFrame];
self.window = [[UIWindow alloc] initWithFrame:screenRect];
This must have been cutting off the clickable area of my views and slicing off the tab bar somehow. I changed it to:

Code:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
And it fixed my problem.
akandels is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, uitabbarcontroller, uitabbaritem

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: 364
11 members and 353 guests
Absentia, akphyo, apatsufas, BinHex, blueorb, fredidf, iGamesDev, Kirkout, MarkC, mottdog, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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