UINavigationBar backarrow problem

Discussion in 'iOS Development' started by hobofan, Sep 5, 2008.

  1. hobofan

    hobofan New Member

    Joined:
    Jun 1, 2008
    Messages:
    68
    Likes Received:
    0
    In my application i have a navbar and a UITransitionView, and everytime I change the view with the transitionview, it creats one of the backarrows in my navigationbar.

    If i click on the arrow it just slides left, and changes the title to the last used title.

    Anyone knows, how I can use the button for changing the view, or make the button disappear???
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    UINavigationBar now is used as a part of UINavigationController, so when you try and set the title using pushNavigationItem:animated: it "pushes" your invisible view with that title, and creates the back button. there is a boolean of which i cannot speak of (sdk junk), so if you look at the sdk headers at UINavigationBar to see how you can hide that button. otherwise, just create a UILabel
  3. Nickll9009

    Nickll9009 New Member

    Joined:
    Sep 19, 2007
    Messages:
    1,367
    Likes Received:
    8
    Device:
    iPod touch
    In your objective-c source code (.m) file-

    Code:
    - (void)useTrans:(int)type toView:(UIView*)view
    {
    	[ mainView transition: type toView: view ];
    }
    
    - (void)navigationBar:(UINavigationBar*)bar buttonClicked:(int)button
    {
            [ self useTrans: 6 toView: viewName ];
    {
    In your header (.h) file -

    Code:
    - (void)useTrans:(int)type toView:(UIView*)view;
    - (void)navigationBar:(UINavigationBar*)bar buttonClicked:(int)button;
    
    
    Of course that doesn't include UITransitionView, you can probably figure that out on your own =p
  4. hobofan

    hobofan New Member

    Joined:
    Jun 1, 2008
    Messages:
    68
    Likes Received:
    0
    i already knew how to use transitions. with ur code, i still can't use the automatic appearing backarrow -.-
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    start using UIViewController and UINavigationController to transition to your other views. its a lot easier and you can get some smooth looking transitions while doing it. also, you'll have access to the other apis that use view controllers like UIImagePickerControlelr and ABPeoplePickerNavigationController.

    Please Register or Log in to view images

Share This Page