uibarbuttonitem

iPhone UIBarButtonItem setCustomView: method?

Hi, I want to customize my UIBarButtonItem's appearance. Here's the code I'm currently using: UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(267, 6, 48, 30)]; [editButton setCustomView:button]; // editButton is the UIBarButtonItem Unfortunately, the UIButton does not get drawn, i.e. it's 100% transparent. I know the b...

UINavigationBar BarButtonItem with Plain Style

Hi, i got the following code: - (id)init { if (self = [super init]) { self.title = @"please wait"; UIBarButtonItem *favorite = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"star.png"] style:UIBarButtonItemStylePlain target:self action:@selector(buttonFavoriteClicked:)]; self.navigationItem.rightBarBut...

How to have multiple rows of items on a UIToolbar?

I'm trying for what is done in Apple's "Maps" app when "Directions" is selected: Does anyone know how to have multiple rows of UIBarButtonItems? I haven't found the answer anywhere. I can add items in a single row to the UIToolbar as follows: NSArray *newItems = [NSArray arrayWithObjects: settingsButton, textFieldStartItem, goBut...

Smaller active area for custom UIBarButtonItem

I have a UINavigationBar with a custom UIBarButtonItem (which uses a UIButton as its custom view). The problem is: the active area of the custom button is much too large, if I tap at least 40 pixels outside the button, it still gets registered as a tap on the button. This results in accidental taps. How can I reduce the active area on th...

UIBarButtonItems not showing up on UIToolbar

I have a UINavigationController with toolbarHidden set to NO. I have added UIBarButtonItems to navigationController.toolbar. The toolbar is displayed, but the buttons are not... What gives? ...

button item lost when hide and unhide toolbar

i dont know, why the button are disappear after the toolbar set to hide and unhide. how can i fix it? setup a button code -(void)viewDidAppear:(BOOL)animated { //NSLog(@"viewDidAppear "); [self becomeFirstResponder]; //Create a button UIBarButtonItem *back = [[UIBarButtonItem alloc] initWithBar...

Is it better to alloc/dealloc new UIBarButtonItems when toggling Edit/Done? Why?

Apple's documentation implies that for a UITableView editable with an "Edit/Done" button, you should create and destroy the button each time it's toggled. Here's a snippet of code "BonjourWeb" sample code project that does this: if (editing) { // Add the "done" button to the navigation bar UIBarButtonItem *doneButton = [[UIBar...

Hide button on first of two UIViews, but have it visible on second...

So I have a UIViewController (main application controller is a TabBarController). On this there is a UINavigationBar, and a UIBarButtonItem. I'm PRETTY sure I hooked up everything correctly in the Interface Builder and that the outlet in the code is connected to the button in the .xib. It should be because the method works correctly. No...

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

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 | UIViewAutoresizingFlexibleRightMarg...

Can I center a UIToolbar item?

I am putting a label on a UIToolbar (per this tip: http://stackoverflow.com/questions/333441/adding-a-uilabel-to-a-uitoolbar). But the toolbar has a button on the left side, and so flexible spaces throw the label off the center, which is where I'd like it to be. Can I somehow center this toolbar item so that it remains centered in the t...

Adding UIBarButtonItem to UINav..Controller

i am not sure what i am missing here. I Have a custom UINavigationController and i am trying to add a persistant UIBarButtonItem to the bar. -(void)viewDidLoad { self.navigationBar.barStyle = UIBarStyleBlack; UIBarButtonItem *bbi = [[UIBarButtonItem alloc] initWithTitle:@"Nope..." style:UIBarButtonItemStyleBordered ...

How do I force one method to be executed before another method?

I've got 2 methods. One method starts playing an audio file (.mp3), the other method updates a UIToolBar to show a button (PLAY or PAUSE). These two methods are called in the following order: //Adds some UIBarButtonItems to a UIToolBar [self togglePlayer]; //Uses AVAudioPlayer [audioPlayer play]; TogglePlayer does this: -(void)toggle...

Sanity check: UIBarButtonItem crashes trying to perform action

One of my users is reporting a crash on his device, an iPhone 3GS. Other devices of the same type are not reporting similar behavior. He's sent me a crash log and based on reading it, I'm not sure how to proceed. I hope I'm not interpreting the crash log incorrectly but it doesn't look like my action has been called yet. This is how I'm...

How can I make the text of a UIBarButtonItem wrap to two lines?

Some of the titles of view controllers in my UINavigationController are quite long, which makes the back button in the navigation bar of the next view controller in the hierarchy miss out some of the text, with a "..." instead. How could I make the text of the back button wrap onto two lines, as with "Now Playing" in the navigation bar ...

Enable UIBarButtonItem if multiple UITextFields are all populated

I have 3 UITextFields in a grouped UITableView and am trying to figure out the correct logic to only have my 'Save' UIBarButtonItem enabled when none of the UITextFields are empty. I'm currently using the - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string UITextFi...

How can you add a UIGestureRecognizer to a UIBarButtonItem as in the common undo/redo UIPopoverController scheme on iPad apps?

Problem In my iPad app, I cannot attach a popover to a button bar item only after press-and-hold events. But this seems to be standard for undo/redo. How do other apps do this? Background I have an undo button (UIBarButtonSystemItemUndo) in the toolbar of my UIKit (iPad) app. When I press the undo button, it fires it's action whic...

Can you manually add to an iPhone/iPad Navigation Bar a back button item?

I have a reference to a "UIBarButtonItem", is there a way I can add a custom "Back Navigation Button" to that item when it is not part of a Navigation based view? I can add a left button: UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Custom Back" style:UIBarButtonItemStylePlain target:self action:@selector(b...

How do I make a UIBarButtonItem 'glow'?

In the Maps app, when you press the tracking button in the lower left hand corner, it glows showing that it's pressed. This makes it behave like a radio button, and it will un-glow once you move the map. Is there a simple way to but a button into the pressed state? ...

UIBarButtonItem with custom image and no border

Hello, I want to create a UIBarButtonItem with a custom image, but I don't want the border that iPhone adds, as my Image has a special border. It's the same as the back button but a forward button. This App is for an inHouse project, so I don't care if Apple reject or approves it or likes it :-) If I use the initWithCustomView:v prop...

Set the position of a UIBarButtonItem Programmatically.

How would I be able to set the position of a UIBarButtonItem? Like, I would like to set it to be on either the very right of a UIToolbar or the very left depending on a state. Thank you. ...