iOS custom navigationBar button item - iphone

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

Related

UIBarButtonItem Done State Without Border

I have a UIToolbar where all the buttons have a style of UIBarButtonItemStylePlain. One of these buttons toggles a setting in my app and I would like to have some type of Selected state when that feature is enabled.
Since I am not using bordered buttons, setting the style to UIBarButtonItemStyleDone would not work because the button would not match. Is there an easy way to change to color of the icon on the button?
For a sample, look at the location button in the Maps app on the iPad. It does exactly what I am looking for.
Sure thing. You can set the background image with initWithImage:style:target:action: or supply a custom view with initWithCustomView:

Can I add an action to the Navigation Bar's title view?

I have a vision for something that I want to achieve, but I don't know if it is possible. Basically, I want my navigation bar's title (the one that is colored and formatted all pretty) to act as a button. I want to be able to press the nav bar title text, and be able to respond to that as a normal action.
Is this possible? I have tried a number of things, and have gotten the blank area to respond to touch as a button, but I can't get the button and the pretty text to be there together.
Thanks!
Create an UIButton with a transparent image and put it over the navigation controller

How To Create A Custom Center Tab Button?

I'm trying to follow this tutorial here to recreate a custom center tab button, but I already have my tabbarcontroller setup in IB. Can anyone help me do this? The tutorial does it all through code so its difficult to follow.
http://idevrecipes.com/2010/12/16/raised-center-tab-bar-button/
All they're doing is creating a blank UITabBarItem, no image or name, simply a placeholder. They then put a UIButton with a custom image (i.e. the green camera button) on top of the UITabBar. Just go into interface builder and add a new TabBarItem and put a UIButton on top of it.

UINavigationBar Images - Objective C

How can I add an image to a UINavigationBar that is a UIButton? For example, take a look at the Safari app. It has some nice buttons on the bottom UINavigationBar. I'd like to put a Share button on a UINavigationBar. Does anyone know how to do this? And does anyone know where I can get a "Share" button? For instance, the type of "Share" button that pulls up an email and emails someone something.
The bottom bar is a UIToolbar and the buttons are instance of UIBarButtonItem. You can use the initWithImage:style:target:action: initializer for your purpose.

iPhone - Custom Tab Icons, Remove Highlight

I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wondering if the images can be coloured or not. I've looked a lot of this, but no one seems to have the solution.
Someone please help.
hide the inbuilt tabBar view
create your own custom UIView (or UIScrollView in case if you need more number of tabs) with the frame of inbuilt tabBar view and fill up, especially with array of UIButtons & then add your custom view as a subview of the TabBarController.
Play with the UIButton's background image (which is your tab icon image) and its addTarget:action:forControlEvents: in order to set the appropriate selectedIndex value of the TabBarController, i.e. set the selectedIndex according to the button's position in the custom view.
This is how I've implemented :)
No. You cannot customise the tab bar icons in the UITabBar.
They are designed to be used with an alpha masked image.
Someone discovered a way to hack the colours though here: Custom colors in UITabBar