Setting navigationItem.leftBarButtonItem - why does it hide my back arrow button ?

Posted by gotye on Stack Overflow See other posts from Stack Overflow or by gotye
Published on 2010-03-21T21:00:18Z Indexed on 2010/03/21 21:01 UTC
Read the original article Hit count: 1427

Hey guys,

When I do this :

    // --------------- SETTING NAVIGATION BAR LEFT BUTTON
    activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0.0,0.0,25.0,25.0)];
    [activityIndicator sizeToFit];
    activityIndicator.autoresizingMask =
    (UIViewAutoresizingFlexibleLeftMargin |
     UIViewAutoresizingFlexibleRightMargin |
     UIViewAutoresizingFlexibleTopMargin |
     UIViewAutoresizingFlexibleBottomMargin);

    UIBarButtonItem *loadingView = [[UIBarButtonItem alloc] 
                                    initWithCustomView:activityIndicator];
    //loadingView.target = self;
    self.navigationItem.leftBarButtonItem = loadingView;
    [activityIndicator startAnimating];
    // ---------------

It hides my back arrow button (the one I use to get back to the previous controller) ... why is that ?!?

How am I supposed to add my activityIndicator next to my back arrow ? (i already used titleView and rightbarbuttonitem)

Thanks a lot,

Gotye.

© Stack Overflow or respective owner

Related posts about uiactivityindicatorview

Related posts about uibarbuttonitem