UINavigationBar : customized button? - objective-c

I want to make a navigation bar looking like BRED's application :
But I don't know how to remove the border and the bottom of the bar button.
Thank you for your advices

If iOS 5 or greater check out the UIAppearance API. Otherwise, there are a bunch of resources on SO to customize the nab bar, including this one. There is no way to just remove the border, you will have to create it from scratch.

Related

How to make the status bar translucent in iOS 7?

In my app, I have some webviews. A transparent status bar doesn't look good for full screen webview. I want to make the status bar TRANSLUCENT, just like the game center.
I notice that the status bar would be drawn translucent if there is a navigation bar under it. But I want a translucent status bar BY ITSELF.
Is there any way to do this?
If you look at the Human Interface Guidelines section about the Status Bar it recommends (emphasis mine on the section most related to your question):
Prevent scrolling content from showing through the status bar. As
users scroll, you don’t want them to see a confusing mix of app
content and status bar items in the status bar area. To give users the
impression of spaciousness while still ensuring maximum readability,
make sure the status bar has a background that obscures the content
behind it. Here are a few ways to keep scrolling content from showing
through the status bar:
Use a navigation controller to display content. A navigation controller automatically displays a status bar background and it ensures that its content views don’t appear behind the status bar. (To learn more about navigation controllers, see “Navigation
Controllers”.)
Create a nondistracting custom image—such as a gradient—and display it behind the status bar. To ensure that the image stays behind the status bar, you could use a view controller to keep the image above a scrolling view or you could use a scrolling view to keep it pinned to the top.
Position content to avoid the status bar area (that is, the area defined by the app’s statusBarFrame property). If you do this, you should use the window’s background color to provide a solid color behind the status bar.
As the status bar is totally transparent and any content can go on top of it, I just create an empty UIToolbar that is 20px height which just looks like a perfect translucent background for the status bar.
This is not an ultimate solution, but it really helps and it is very easy to implement when you don't need a real tool bar.
Thanks to Apple that they do not provide an option to set the status bar from transparent to translucent.
In Xcode 6, create top, bottom, left, right constrains and set the
- constants to 0
- priorities to 749.
- Don't forget to UNCHECK the "Constrain to margins" check box.
How to create constrains?
At the bottom right of your storyboard window, there's four buttons. The second from your left has the constrains. Please google about constrains in Xcode 6 since it's a kinda new feature.
Hope this help,

IOS: How to make a tab bar on the left on iPad

I've seen many apps creating a side bar on the left like the image above. Apparently this is not a split view controller since the size is fix for that.
Anyone know how to do it? May I get some directions or advice on this?
It is shown in this tutorial, how you can implement that kind of "custom side Tab Bar", he did a video about it too.
That can be done simply by adding to your main view a UIView with a "vertical" frame, e.g. (0, 0, 44, screenHeight). That view should be then populated with all the icons you need...
There is nothing more to it, as far as I can see.
You can't use the default UITabBarController from iOS. You will need to do your custom tab bar. You could use an UIView with some UIButtons added as subviews.

Use custom Navigation Bar in iOS

I added a Navigation Bar to the .xib.
I did that because I want to customize a lot of things of it. I want my navigation controller to use that navigation bar in that screen.
I created the outlet named navBar and did:
[self.navigationController.navigationBar = navBar;
But it says that navigationBar is readonly. Is it possible to link my existing navigation controller with the navigation bar that I added to the screen?
It sounds to me that you may not actually want to use a UINavigationBar. As it states in the reference documentation:
The UINavigationBar class implements a control for navigating hierarchical content. It’s a bar, typically displayed at the top of the screen, containing buttons for navigating up and down a hierarchy. The primary properties are a left (back) button, a center title, and an optional right button. You can specify custom views for each of these.
So if you're planned customizations go beyond adding buttons, changing it's color / background, opacity, hiding etc.. you might be better off creating a UIView that mimics the look & feel of a navigation bar.
Here's an example of how to give your UIView that gradient look of a navigation bar.
It's far more flexible and actually quite easy to do BUT you've got alot of reading and testing ahead of you :).
Just in case if it's just buttons you're thinking of adding you might be better off using UIToolbar instead
You can't do that. Since the navigation controller's navigation bar has a lot of settings embedded, it's a readonly property and you shouldn't be able to change it.
What exactly are you trying to achieve that you need to do that via interface builder. I mean, with the newest APIs, it should be simple to do everything you want with a few lines of code, by customising the original navcontroller's navbar.
You would not manage a navigation bar in interface builder. Also, you would not try to set the navigationBar property of the navigation controller.
To make changes you would make changes to the navigationItem property of the navigationBar
[self.navigationController.navigationBar setItems:newNavItems];
You can also make other changes to the navigationBar such as setting a background image or making it translucent
self.navigationController.navigationBar.translucent = true;
[self.navigationController.navigationBar setBackgroundImage:img forBarMetrics:barMetrics];

How to make a tab bar that shows colored icons , on iOS?

I need to make a toolbar on the bottom of the screen with some buttons. I want in every button to have a small image and a small text under it. The closest i can find from "Xcode" is the "Tab Bar" where you can put icons and text but the problem is that when you add an image you can only see the shadow of the image and not its colors.. Can i change that? Or is another way to make a toolbar like the one i am describing?
EDIT
I need the buttons to change controllers and i just noticed that i cant create actions for the tabs but only outlets. So i guess the tab bar is not what i should use. Any ideas for a toolbar?
Yes Tab Bar is the Best approach for it and it is very easy to customize the tab bar if u are using IO5
This LINK will be helpful.
There is another approach (which was applicable uptil IOS4 for customization of Tab bar) was to Create Custom buttons with tab bar look alike Images. it will give u the same feel, but like i said it is very easy now to customize IOS Tab bars
Here is a couple of Links for u
LINK 1 With Story BOARD
LINK 2 Without Storyboard
One More thing Try searching Google before Posting a question here if have some problem then feel free to post along with the code or tutorial u tried.
Let me know if i Worked
Cheers
W

How to customize tab bar controller so that tabs appear on the top of the screen?

How to customize tab bar controller so that tabs appear on the top of the screen?Tabs should not appear at bottem of the screen.
Try this,
self.tabBarController.tabBar.frame=CGRectMake(0, 0, 320, 70);
You will need to create a custom control. The standard UITabBar does not offer the option to place tabs at the top unfortunately.
Tabs should not appear at bottem of the screen.
Actually, according to the iOS human interface guidelines, they should:
A tab bar appears at the bottom edge of the screen and should be accessible from every location in the application.
If you really wanted to do what you are asking, you could use a UITabBar directly (not touching UITabBarController). That handles drawing the tab bar itself, but doesn't do any view swapping for you. You should then write a custom container view controller using the view controller containment APIs (iOS 5 only) which you set as a delegate method on your tab bar, and then when the user changes tab, you swap in and out the relevant views.
Or you could use this open source version.
Don't make your top tab bar look like a standard Apple tab bar though, because they'll probably reject it from review. If you use a completely custom look you should be fine.