How to add a 'title' to a UIBarButtonItem - iphone

I understand how to creata UIBarButtonItem with text and make it look like a title. I essentially want one more line of smaller text below that 'explaining' what the big text is.
using initWithCustomView with 2 views seems to get much more complicated because of width.

The only possible solution is to use initWithCustomView method on the UIBarButtonItem and then set the left or rightBarButtonItem property in the UINavigationItem with this bar button.
And to add the obvious, your customView can be the multiline UILabel.

Related

UIToolbar reuse like inputAccessoryView

Some quest!
If i have toolbar in view(bottom) and i want that he will become like input accessoryView for textview. It is possible? Or i must use animations core for this manipulation?

iOS custom navigationBar button item

I would like to set navBar buttons like safari as following image shows. However I can only set a custom image for toolbar button but square button container remains although I set plain style. How to reach it? Thank you
Plain is only for tool bars not nav bars, that's the only way you can achieve no border. You must use a custom UIButton on your navbar to achieve the same results.
If you need an icon somewhat like that, you can check on Default Icon
Use UIBarButtonItem method for creating bar button
- (id)initWithCustomView:(UIView *)customView;
and create custom view with UIButton of type UIButtonTypeCustom

UITabBar look like UIToolBar (changing color of UITabBar)

Is it possible to make a UITabBar look like a UIToolBar, while maintaining its UITabBar-functionallity?
Bottom to top http://files.droplr.com.s3.amazonaws.com/files/14763142/1eiof1.Skjermbilde%202010-06-20%20kl.%2022.29.13.png
Make the UITabBar (bottom) look like the UIToolBar (top).
Thank you.
In addition to my question, I want to know how I can change the backgroundcolor of my tabBar. Is is possible? Does anybody have a library that subclasses the TabBar and changes its color?
Instead of making the UITabBar look like a UIToolBar, I would instead try making a UIToolBar have the functionality of a UITabBar- e.g. pressing on the buttons opens different subviews. Then, you could set the background color of the UIToolBar (it's actually listed as "Tint" in the properties).
You might use images that look like toolbar buttons...
Have I understood your question correctly?
You want to change the look of tab bar's items so they will look like toolbar items?

UIBarButtonItem does not appear to respond to "style" property

Situation: I'm placing an instance of a system "item action" button into the right navigation button slot... no problems there. However, I want that button to display as just the icon WITHOUT a border around it (ie: "plain" style). Reading over documentation, it sounds like this should be a simple matter of just setting the UIBarButtonItem's "style" property to UIBarButtonItemStylePlain, like so:
UIBarButtonItem *shareButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:#selector(didPressShare)];
shareButton.style = UIBarButtonItemStylePlain;
self.navigationItem.rightBarButtonItem = shareButton;
[shareButton release];
However, when I implement the above code, the button appears in the nav bar with a border around it... apparently the system is not observing my UIBarButtonItemStylePlain setting. Any ideas as to why? Any other solutions for making a button appear a just the icon and no border around it?
Thanks in advance!
I'm sorry to tell you, but as far as I know you can't use plain style with UINavigationBar.
If it is possible use UIToolbar instead.

How do I set the color for the editButtonItem in the navigation bar of a UITableViewController?

I have a UITableViewController where I added a "editButtonItem" in the navigation bar :
self.navigationItem.leftBarButtonItem = self.editButtonItem;
No magic here, but I try to define the color (background and foreground/textcolor) of this button.
I read in the Apple forum somewhere that the button changes the color if I change the navigationbar to the same color, well despite the fact that I do not get this to work either (for testing) I do not want to touch the navigationbr itself, just the button.
Since this button is already predefined I am not sure how to handle this. Do I need to overwrite the button with my own definition or can I just simply apply a new style (if so how ?)
Thx
If everything fails, you can tint the bar in the viewDidLoad of your childViewController
[self.navigationController.navigationBar setTintColor:[UIColor colorWithHue:50 saturation:50 brightness:.2 alpha:.5]];
The only way I can find to make a UIBarButtonItem with a different color is to use a custom view and the initWithCustomView: method. Predefined buttons and those created using initWithTitle:target:action: cannot change their background color.
Take a look at this SO question: UIBarButtonItem with color?
These links might also help:
http://www.iphonedevsdk.com/...
http://www.insanelymac.com/...