Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

patrover

macrumors newbie
Original poster
Aug 15, 2009
25
0
hello
i have a TabBar in my application and i want to load the address book into one of the tabs, i use this:
Code:
- (void)showPicker {
	ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
	// place the delegate of the picker to the controller
	picker.peoplePickerDelegate = self;
	
	// showing the picker
	[self presentModalViewController:picker animated:NO];
	// releasing
	[picker release];
}

the problem is that the address book is covering the tab bar , how can i solve this?

thank you :)
 
Hmm..that is an interesting question...you can try to use the view for the tab instead of self presentModalViewController. Just a suggestion.
 
the UITabBar is a UIView, so you can try to bring it to front after you display the address book picker. (i dont know if it works, i never tried it.) but even though, i'm affraid you will be loosing the capability to display the very last row of the address book, as it will show underneath the tab bar. alternatively, take all the entries from the address book and put them in your own table view.
 
I would think you could change the size of the ABPeoplePickerNavigationController so it will display correctly in your view. Something like this may work:

Code:
- (void)showPicker {
	ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
	// place the delegate of the picker to the controller
	picker.peoplePickerDelegate = self;

        CGRect newFrame = picker.view.frame;
        newFrame.size.height = newFrame.size.height - 49;
        picker.view.frame = newFrame;
	
	// showing the picker
	[self presentModalViewController:picker animated:NO];
	// releasing
	[picker release];
}

Since the tabBar is 49 pixels (I think, you may want to double check this) you can just subtract that much from the height of your 'picker'.
 
help plz...

I would think you could change the size of the ABPeoplePickerNavigationController so it will display correctly in your view. Something like this may work:

Code:
- (void)showPicker {
	ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
	// place the delegate of the picker to the controller
	picker.peoplePickerDelegate = self;

        CGRect newFrame = picker.view.frame;
        newFrame.size.height = newFrame.size.height - 49;
        picker.view.frame = newFrame;
	
	// showing the picker
	[self presentModalViewController:picker animated:NO];
	// releasing
	[picker release];
}

Since the tabBar is 49 pixels (I think, you may want to double check this) you can just subtract that much from the height of your 'picker'.

Hey.. what does this 'peoplePickerDelegate' in the following line mean
picker.peoplePickerDelegate = self;

And did this worked out and got the toolbar visible. I still have the problem. But may be because i have not set the delegate. So plz guide me with ur comments as soon as possible....
Thanks in advance,
Brian.
 
Thank you for the reference

I have gone through it and understood that they are used only if we load the address book into a tab in a tabBarController.
I am not loading an address book. Instead i am calling a presentModalViewController and i am about to perform some actions like bar button edit in this page.
So i would like to know that is there any possibilities to make the tabBar visible in a presentModalViewController where we edit the bar items.

Do help me with your comments..

Thanks,
Brian
 
I have gone through it and understood that they are used only if we load the address book into a tab in a tabBarController
I'm afraid you misunderstood then because it doesn't say that at all.

I am not loading an address book. Instead i am calling a presentModalViewController and i am about to perform some actions like bar button edit in this page.
So i would like to know that is there any possibilities to make the tabBar visible in a presentModalViewController where we edit the bar items.
You can present any UIViewController (or subclass thereof) with presentModalViewController. UITabBarController is a subclass of UIViewController. So, I'd say: yes, it is possible.
 
Ya, i am new to this programming. I thought that the peoplePickerDelegate is a built in delegate used for the addressbook functionalities. Sorry for that.

I couldn't make the tab bar visible at all. Could you help me with the codes for making the tab bar visible on a presentModalViewController. It would be more helpful for me.

In the tabBarController, there are 4 bar items in the tab bar. First 3 bar items opens tableviewcontrollers and they are working fine. But the 4th bar item when clicked, opens the presentModalViewController. But it hides the tab bar.
I tried the following code in the 4th bar item's action.

Code:
- (void)setEditing:(BOOL)editing animated:(BOOL)animate{
ConfigureSectionScreen *configure = [[ConfigureSectionScreen alloc] init];
[self.tabBarController presentModalViewController:configure animated:YES];
[configure release];
}

I don't know what is the wrong with it. Please guide me with your comments and codes(if possible).

Thanks,
Brian
 
i got it done..

Actually there is no problem with the codings. I was confused with the built in more button that comes while the number of baritems increases. I got it cleared now..
 
Same issue

Hi I am having a very same issue.
Please advice if someone knows the exact fix.
 
AddressBook and Tabbar Controller

Hi, I have a TabBar in my application and i want to load the address book into one of the tabs. the problem is that the address book is covering the tab bar , how can i solve this?

There is a very similar post from 2009, below link - But there is no fix. :-( please advice.

https://forums.macrumors.com/threads/766213/

Thanks in advance.
 
Sorry to dig up an old thread but this is exactly what I'm looking for but I have no idea how to implement it. What I'm looking for is to have the Contacts TabBar open up contacts and I don't know where to put the code. I've create a new TabBar project for testing. So I've got a clean project but where do I place the code?

Code:
- (void)showPicker {
	ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
	// place the delegate of the picker to the controller
	picker.peoplePickerDelegate = self;
	
	// showing the picker
	[self presentModalViewController:picker animated:NO];
	// releasing
	[picker release];
}

So my second tabBar item is the one that should open it. Should I place the code in the secondViewController .m and it should just work? Do I need to do something to app delegate? How do I connect the tabBar icon to "picker"?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.