uinavigationitem

How do I calculate the optimal titleView width?

I am using navigation with a custom UIView subclass that becomes my titleView. I want to ensure this is the full available width. Logically from my UIViewController's viewWillAppear:, this should be: CGFloat width = self.width - self.navigationItem.leftBarButtonItem.width - someConstant; (I don't have a right item here.) This would ...

UIBarButtonItem in middle of navbar?

I have created a flexible navigation bar in my app that will show custom buttons on the left, right, and in the middle. So far I have got working: Right/Left/Middle - Custom Image and/or Text Right/Left - Normal looking button with custom Image in it Right/Left - Normal looking button with custom Text in it By 'normal looking' I mea...

UINavigation bar background in iPhone

I have applied following code to my application to change the navigation bar image. - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController.navigationBar setTintColor:[UIColor blackColor]]; [self setNavigationBarTitle]; } -(void)setNavigationBarTitle { UIView *aViewForTitle=[[[UIView alloc] in...

Custom background for UINavigationBar problems

Hi there, I've managed to add a custom background to my navigation bar by using: UIImageView *iv = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"UINavigationBar.png"]]; [myViewController.navigationBar insertSubview:iv atIndex:0]; [iv release]; This works fine and I can see the title and buttons okay. However, when I drill ...

How do I change the title of the "back" button on a Navigation Bar

Currently the left bar button default value is the title of the view that loaded the current one, in other words the view to be shown when the button is pressed (back button). I want to change the text shown on the button to something else. I tried putting the following line of code in the view controller's viewDidLoad method but it do...

iphone-dev: TabBarItem help

Hi, I have am setting up my application like so (in applicationDidFinishLaunching): mytable = [[[MyTableController alloc] initWithStyle:UITableViewStylePlain] retain]; UINavigationController *mynav = [[[UINavigationController alloc]initWithRootViewController:mytable] autorelease]; [mynav.view setFrame:CGRectMake(0,0,320,460)]; UIVi...

UINavigationItem back button returns to previous navigationitem, but view doesn't change

Hello, I have a "didSelectRowAtIndexPath" action that adds a navigation bar and displays a new view. There's an action in the new view that pushes another view onto the navigation stack, and it works, but clicking "back" doesn't restore the previous view. The sequence is basically: user clicks table cell Navigation bar appears, with...

UISearchBar and UINavigationItem

I can't seem to get a UISearchBar to position itself from the far left to the far right in the navigation bar. In the -(void)viewDidLoad method, I have the following code: `UISearchBar *sb = [[UISearchBar alloc] initWithFrame:self.tableView.tableHeaderView.frame]; sb.delegate = self; self.navigationItem.titleView = sb; [sb sizeToFit]; [...

UINavigationBar background image via drawRect - issue with prompt animation

I'm adding a custom background image to my UINavigationBar by overriding the drawRect via a category. - ( void )drawRect:( CGRect )rect{ [[UIImage imageNamed:@"navbar.png"] drawInRect:CGRectMake( 0, self.frame.size.height-44, self.frame.size.width, 44 )]; } This solution seems to work fine, until you try to make use of navigatio...

iPhone: UINavigationBar with buttons - adjust the height

Hi developers, I am working on an iPhone application which works in both orientations: portrait and landscape. I am using for one view and tableview embedded in an UINavigationController. The height of this navigationbar with its buttons is either: 44px portrait or 34px landscape. Within a different view I created the UINavigationBar...

UINavigationBar subview is hiding the right UIBarButtonItem

In the root table view controller I add a subview that holds an image: [self.navigationController.navigationBar addSubview:imageView]; Then in a child table view controller that I push onto the stack I set a right UIBarButtonItem: UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemSty...

UINavigationItem.prompt appearing, moves the view below. How to listen for a new prompt?

I have a normal UINavigationController with a UIViewController contained in it, when my view controller has a prompt applied to it (via a UINavigationItem.prompt = @"some prompt"), the prompt is animating the UIViewController's view downward. My question is, is there an apple what to find out that a prompt will appear (and maybe the an...

how i can change the background color of navigationBar

Hi developer, In my navigation bar i have two button at left and right position and a segmentetControll view at navigation title. I want to change the background color of the navigation bar to black but thae color of the items on it will be another color. how can i do it? I try to chnage the tintColor of the navigationBar to black. but i...

Standard way to have a UIBarButtonItem point to the right?

When a new view controller is pushed onto the navigation stack, there is standard support for a back button with the title of the previous view controller. This button "points" to the left rather than having a rounded rectanglar shape. Is there a standard way to create a UIBarButtonItem that "points" to the right? This button would be u...

Colors and buttons change behavior when tinting iPhone navigationBar

Hi I was wondering why everything stops behaving as it should when I do something like this: self.navigationController.navigationBar.tintColor = [UIColor blackColor]; All my buttons on the navigationBar are now black regardless of style, like this one below, it should turn up as a blue button: UIBarButtonItem *editButton = [[UIB...

After pushViewController, how to disable the backBarButtonItem?

After pushViewController, how to disable the backBarButtonItem, that going back will not be possible? tnx :) ...

Doubt About NavigationBar

When we give the option Navigation Bar with prompt for a navigation bar, its height doubles with the items like titles and button being pushed into the bottom half. Is there a way that I can keep those at the top and add a label at the bottom part? ...

UISegmentedControl, UIToolbar and UINavigationItem

I've create a UISegmentedControl and successfully attached it to my navigationItem.tableView. But when I try instead to attach it to a UIToolbar, it blows up. I'm sure I've seen UISegementedControls on toolbars before - but can't seem to get it working. Thoughts? // works NSArray *statusItems = [[NSArray alloc] initWithObjects:@"one",...

UINavigiationBar left / back image scaled?

Trying to use a nice 'back' arrow image, like that found in Apple's iPod app - when I add my 30x30 image it seems to squashed or scaled, as it looks tiny? Is it possible that the UINavigationBar's back item will have to be custom view perhaps? ...

Add both UIBarButtonSystemItemAdd and UIBarButtonSystemItemTrash to one side of a Navigation Item or a UISegmentedControl

Hi there, Well, the title says it all. I'd like to have a UIViewController which has an Add and a Trash button both right to the title, either by adding two UIBarButtonItems to the navigation item/bar or by adding them to a UISegmentedControl and then adding the SegmentedControl to the item. Is this possible? If yes, how is it achieved ...