uibarbuttonitem

iPhone UIBarButtonItem with custom view but also having a UIBarButtonItemStyle

Hi there, I am creating a UIBarButtonItem with a custom view in order to achieve a transition to a UIActivityIndicatorView as described here - however I really want my button to retain a normal UIBarButtonItemStyle such as UIBarButtonitemStyleBordered Is there a way to achieve this? Thanks! ...

Persistent rightBarButtonItem Property of UINavigationItem

This may be a stupid question, but is it possible to keep a right UIBarButtonItem across multiple views managed by a UINavigationController? I have a progression of views that often share the same right UIBarButtonItem, but when I push a new view to my UINavigationController, I have to redefine the button every time, even if it hasn't ch...

UIToolBar - How to Handle Button-Overflow?

I have a view with a toolbar - each button on the toolbar represents a new message the user is composing. It took me several work days to figure out how to handle the view switching, etc.. but now that I have that all figured out, I have run into a bit of a UI-snafu. When I have over 11 buttons (I know, a user should really SEND the fir...

iPhone: how to reduce UIBarButtonItemWidth ?

Hi, I've created a UIBarButtonItem and then set self.navigationItem.rightBarButtonItem to the item. However, setting the width property of the barButtonItem doesn't seem to have any effect on the width of the button (I'm trying to reduce the width of the barButton) If I use a custom view for the UIBarButtonItem, I'm able to set the wid...

UIBarButtonItem crashes iphone app when button is clicked

UIBarButtonItem *rButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:NULL]; rButton.action = @selector(refreshAction); self.navigationItem.rightBarButtonItem = rButton; [rButton release]; The above code works fine to create a button and add it to the navigation bar, but...

Unwanted Edit button in my navigation bar?

Hi, I've got the following code in my app to display a modal view: InfoTableViewController *infoTableViewController = [[[InfoTableViewController alloc] initWithNibName:nil bundle:nil] autorelease]; infoTableViewController.title = @"Pirateometer"; infoTableViewController.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] init...

Shadow effect for UISegmentedControl?

I am using a UISegmentedControl with images that is in a UIBarButtonItem, which is itself in a UIToolbar. If I use an image for a "normal" UIBarButtonItem, a nice shadow effect is automatically applied. However, the same does not automatically apply to images in UISegmentedControl's that belong to UIBarButtonItem's. I was thinking of ...

iPhone dev - Passing arguments in a selector

I have a barButtonItem that calls an action which swaps two views in an animation block. I disable the barButtonItem at the beginning of the action method that it calls, and the I want to enable it when its finished, so that the user can't flip the view again before it has finished flipping. It does this in a UIView animation block, so...

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

UINavigationBar tintColor does not always propagate to UIBarButtonItem objects

Greetings! I have set my UINavigationBar's barStyle to UIBarStyleBlack, and the tintColor to a color (other than black so as to get the color/gradient going). That much works well. Now ... let's say I push a new view controller onto the nav controller stack. In this particular VC, I want the nav bar to turn black, but only within this V...

How do I add UIBarButtonItems to a UIViewController.toolbarItems property using Interface Builder?

I'm trying to use Interface Builder to add UIBarButtonItems to the toolbarItems property of the UIViewController. I have a .xib file and the File's Owner is typed as a subclass of UITableView controller ("ServerTableViewController"). I've dragged a bunch of UIBarButton items into the .xib file thinking that they will show up as part of ...

Which is the tintColor of UIBarButtonItem with UIBarButtonItemStyleDone?

Hi, I would like to use a UISegmentedControl with two buttons as a replacement for a single 'Done' button. To achieve this, I need to know the tintColor of UIBarButtonItems with UIBarButtonItemStyleDone. Cheers and thanks in advance MrMage ...

How do you add more than one UIBarButton on UINavigationItem.rightBarButtonItem (or leftBarButtonItem)?

I have tried this approach/hack: http://blog.blackwhale.at/2009/06/uibuttons-in-uinavigationbar/ The problem is this leaves a faint seam. I tried setting the background image of the nested toolbar to an image I captured of what it should be. That didn't work. The image was not applied. I have also tried using a nested UINavigationBar an...

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

UIToolbar UIBarButtonItem with both image and title has very dim text

My iPhone view adds some custom buttons to its toolbar. Each button has both an image and textual title, and is created like this: UIBarButtonItem *fooButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"foo.png"] style:UIBarButtonItemStylePlain target:self action:@selector(fooButtonPressed:)]; fooButton.title=@"Foo"; ...

How big should a UIBarButtonItem image be?

I'm looking to create my own custom Sort By Date and Sort By Number buttons that I plan on placing in the navigation bar as the right button. How big should my image be to appropriately fill the space -- the UIBarItem documentation page doesn't list anything about the size the image should be. ...

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

How to change UIBarButtonItem's type in UINaviagationBar at runtime?

Hi, I am working on an iPhone's view which composed 3 elements, UITextView, UIToolBar with an UIBarButtonItem. The goal is, I want UIBarButtonItem change its style from 'edit' (UIBarButtonSystemItemEdit) to 'Done' (UIBarButtonSystemItemDone) and update new selector to new method. First of all, I have tried following code but it doesn'...

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

How do you create UIBarButtonItems with a radio interface?

I have a UIToolbar that needs three buttons in a radio style, meaning that of the three, only one button can be pushed at a time. The documentation makes reference to the possibility of setting up radio UIBarButtonItems in the class reference definition of the width property: If this property value is positive, the width of the co...