I have a table view with the following code:
Code:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
UIButton* modalViewButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[modalViewButton setTitle:@"+" forState:UIControlStateNormal];
[modalViewButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[modalViewButton addTarget:self action:@selector(modalViewAction:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *modalButton = [[UIBarButtonItem alloc] initWithCustomView:modalViewButton];
self.navigationItem.leftBarButtonItem = modalButton;
[modalViewButton release];
However, it isn't working. I have a black bar on top for the title with a black edit button, so I just want a black square button with a white plus sign in it. Any help? I can't do it in IB.