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

View Single Post
Old 04-08-2010, 02:45 PM   #14 (permalink)
vikinara
Registered Member
 
Join Date: Mar 2010
Posts: 84
vikinara is on a distinguished road
Default got it working

I got it working with this

[toolbar removeFromSuperview];

Check this

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];

//Initialize the toolbar
toolbar = [[UIToolbar alloc] init];
toolbar.barStyle = UIBarStyleDefault;

//Set the toolbar to fit the width of the app.
[toolbar sizeToFit];

//Caclulate the height of the toolbar
CGFloat toolbarHeight = [toolbar frame].size.height;

//Get the bounds of the parent view
CGRect rootViewBounds = self.parentViewController.view.bounds;

//Get the height of the parent view.
CGFloat rootViewHeight = CGRectGetHeight(rootViewBounds);

//Get the width of the parent view,
CGFloat rootViewWidth = CGRectGetWidth(rootViewBounds);

//Create a rectangle for the toolbar
CGRect rectArea = CGRectMake(0, rootViewHeight - toolbarHeight, rootViewWidth, toolbarHeight);

//Reposition and resize the receiver
[toolbar setFrame:rectArea];

//Create a button
UIBarButtonItem *infoButton = [[UIBarButtonItem alloc]
initWithTitle:@"back" style:UIBarButtonItemStyleBordered target:self action:@selector(info_clicked:)];

[toolbar setItems:[NSArray arrayWithObjects:infoButton,nil]];

//Add the toolbar as a subview to the navigation controller.
[self.navigationController.view addSubview:toolbar];



[[self tableView] reloadData];

}

- (void) info_clicked:(id)sender {


[self.navigationController popViewControllerAnimated:YES];
[toolbar removeFromSuperview];

}


Hope this helps. It worked for me

Thanks
Viki

Quote:
Originally Posted by FnGreg7 View Post
Slybitz, I have the exact same problem going on.

Did you find a solution?

Last edited by vikinara; 04-09-2010 at 09:57 AM.
vikinara is offline   Reply With Quote
 

» Advertisements
» Online Users: 400
11 members and 389 guests
baja_yu, chemistry, Farfalo, garticle, GraffitiCircus, greeneye82, hussain1982, iconomania, stanny, zhijianhi
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,556
Threads: 94,079
Posts: 402,739
Top Poster: BrianSlick (7,990)
Welcome to our newest member, wfarun2012
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:30 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.