views:

55

answers:

1

So, i got this Navigation-based App (with a custom NavigationBar - Category) and I have 2 problems here...

@implementation UINavigationBar (Custom)

- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed: @"bg_toolbar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}

@end

Because of the Navigation-based App, most of the views have a height of 436px (= ScreenSize - NavigationBar height, as you probably know ;).

I got one view similar to the photo app overview showing all the thumbnails, from there I push a viewcontroller containing the scroll view (like in photos app) on the stack, like so

- (void)buttonPressed:(id)sender 
{
    UIButton *btn = (UIButton *)sender;
    PhotoSetScrollViewController *psc = [[PhotoSetScrollViewController alloc] initWithPhotoArray:photos andID:btn.tag];
    [self.navigationController pushViewController:psc animated:YES]; 
}

Problem 1: The view holding the fullscreen scrollview has a height of 480px which seems to be a problem because when poping the viewcontroller by hitting the back button, the view containing the thumbnails (height 436px) moves upward below the navigation bar. And also the Toolbar keeps showing. What could be the problem?

EDIT: The fullscreen scrollview is also moving when the navigation and toolbar are shown (hidden initially). And even without the custom navigationbar i get the views floating around. That is weird.

Problem 2: How could I switch between my custom navigation bar and the standard black translucent style?

A: 

jd,

Problem 1: Please clarify your question.... Are you trying to make it the same as the Photos app, where you click on a single photo and then you can hide the nav bar and the toolbar? Unless you explicitly hide the toolbar, it will continue to show when you pop your view by hitting the back button. You can delay the pop view and hide it or hide it within the viewDidAppear method of the prior view controller.

If your view is moving around, you may want to check your frame settings in IB (2nd to the last tab in the inspector window after you click on the view in question). Also, make sure you put the faked in nav bar in your XIB files so you can lay everything out correctly.

Problem 2:

First, check this post: http://stackoverflow.com/questions/901542/using-image-or-tint-color-on-uinavigationbar-in-iphone

Then use this as well:

self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
iWasRobbed
Thx Rob! Problem 1: Yes I try to make it the same as the Photo App. I basically worked it out with a modal view which is just fine for the project, so I don't have problems with the floating around. Problem 2: is also solved thanks to you. I dont know why I haven't found this myself on here...One more thing: I see your from Melbourne, FL. Are you a freelancer or are you working at a company? Cause Im tryin to find a job as a developer over there but I don't know any good companies.
jd291
Glad to hear it. I just do this stuff for fun mostly after my real job gets over with... I don't know of any companies over here that do iphone dev, but there are plenty of other software related jobs if you have a degree. You can always check out elance.com if you need freelance work, but i've found you can make decent money on the appstore too. Best of luck with the job hunt
iWasRobbed