Hello all what I would like to know is it even possible to change the Color of the top bar in this UITableView ( the nav + toolbar )(code wise).
http://sites.google.com/site/iphonesdktutorials/images/navtoolbar/App.jpg
Another question concerning the top bar , how do they manage to remove the backbutton
like here item 1 is the one I want to remove code wise.
http://1.bp.blogspot.com/_ixq8Dp4ESMo/Sc-qrEQzclI/AAAAAAAAAG4/EOqFoiQU9uA/s1600-h/detailview.jpg
1) Pull up the Tools->Attribute Inspector for you UINavigationBar in interface builder. Adjusting the Style and Tint attributes, among others, is the way that I have created many of my navigation bars.
2) If you would rather not see the back button, you can simply use the built in hide mechanism (from UINavigationItem reference):
setHidesBackButton:animated: Sets
whether the back button is hidden,
optionally animating the transition.
-(void)setHidesBackButton:(BOOL)hidesBackButton
animated:(BOOL)animated
Parameters:
hidesBackButton YES if the
back button is hidden when this
navigation item is the top item;
otherwise, NO.
animated YES to animate the
transition; otherwise, NO.
It would look like this:
[theNavBarItem setHidesBackButton:YES animated:false];
What's handy is that this sets a BOOL property that should keep the back bar hidden.
This is not about the UITableView but, a navigation controller.
There are many samples and guides out there on using table views in navigation controllers, including how to customize (e.g., the color of the top bar, or adding/removing/relabelling buttons).
One starting point is the apple website.
http://developer.apple.com/iphone/library/featuredarticles/ViewControllerPGforiPhoneOS/UsingNavigationControllers/UsingNavigationControllers.html
Related
I want to implement a drop-down list in the navigation bar, which contains all categories such as in this application:
I want to know what its name, and steps to implement it.
You need to place your View underneath the navigation bar but put its position to high so it isn't visible. Then when you press that button use UIViews animations to slide it down. It's that simple and there isn't any special kind of view.
YOu can try something like this also ... https://github.com/kolyvan/kxmenu
I have been coding in iphone platform for about a few months. One thing I am still to understand is in which method exactly should I set the navigation bar/toolbar/barButtonItem hidden.
In my project sometimes I set in - (void)viewDidLoad, sometimes I set in - (void)viewWillAppear:(BOOL)animated. Sometimes I set it from where I push the navigation controller.
I think I am not understanding the basics correctly. If one way is not working, I try the other way and somehow it works.
If I am to hide the toolbar or barbuttonitem in navigation controller, where exactly should I set that.
Edit:
If I am pushing a new navigation controller, in which I want my toolbar hidden, where should I set it hidden. Similarly, when I pop it, I want the the toolbar to be shown, where should I set the toolbarHidden property to 'NO'.
Similarly, I have a navigation controller, sometimes it needs to show the toolbar and sometimes it needn't, where should I check the condition for this case.?
You should set this property before the pushing the view Controller and don't need to set No at pop. E.g see the following link:
hiding tabbar on table view cell click
I want a UINavigationBar at the top of my UIWebView but I want to control by hand the title, the back button, what the back button does - etc. In other words I never want to push or pop views. I just want to change the UINavigationBar contents as the user clicks around the web view.
Where I'm up to is I added the UINavigationBar to my superView and made it 44 pixels tall. How do I set the title since I have no navigationItem? How would I set a fake back button up?
I would appreciate any pointers. I realise this is quite weird what I'm doing.
Thanks :)
The answer, if anyone's interested, is in the class reference of UINavigationBar.
When you use a navigation bar as a standalone object, you are
responsible for providing its contents. Unlike other types of views,
you do not add subviews to a navigation bar directly. Instead, you use
a navigation item (an instance of the UINavigationItem class) to
specify what buttons or custom views you want displayed. A navigation
item has properties for specifying views on the left, right, and
center of the navigation bar and for specifying a custom prompt
string.
In short, use a UINavigationItem and apply it by "pushNavigationItem" on the UINavigationBar.
I created a subclass of UINavigationBar called StaticNavigationBar which I can then load with any state by putting the appropriate UINavigationItem's on it. Thanks for all your answers people.
You can have that UINavigationBar as an outlet and then you can manupulate it as you want. So you don't have to refer to somebody's navigation item. It'll be an independent (sort of) object on your view.
If you dont want the navigationbar as-is youll have to roll your own.
if youre ok with the built in animations for pushing and popping items(dont confuse with push/pop of viewcontrollers) to the bar you would then set your UINavigationBarDelegate and use its methods for controlling how things push/pop, etc.
I am trying to build a screen like this:
I've already built the navigationItem (the "title Bar") and the table view, now I'm looking for a way to add the buttons under the table view.
The result should look similar to a tab bar, but as the buttons are used to influence the the number of displayed records in the table, I'm only dealing with one controller.
How do I achieve what I'm looking for?
I can think of two ways off the top of my head you could accomplish something like this.
You could create a UISegmentedControl and place it in your tableview's tableFooterView property. The buttons would only be visible underneath the tableview and would scroll with the table.
You could create a UIToolbar, or ideally display the toolbar you get for free with the navigation controller, and place a UISegmentedControl there. This way the buttons would always be visible regardless of where the user has scrolled to.
Hope this gets you started.
A couple of approaches suggest themselves:
1) You could use an actual tab bar. If you do that, your outermost view controller has to be the UITabBarController. Some searching on "UITableView inside UITabBar" and the like should give you more details.
2) Set the frame of the UITableView to be less than the whole screen. Have both it and the buttons (which might well be a UISegmentedControl) be subviews of a common container.
I want to use Tabview for my whole app. However in certain view, I have more operations than I can fit in the navigator bar. So I thought of using Toolbar but toolbar should be located at the bottom, right? Toolbar looks weird to be on top of the tabview, and hiding tabview for one view doesn't really make sense. I guess I can go with more buttons in the main view, but any other alternatives?
What can one use to add more operation(s) to tabview?
Thanks
In regards to keeping the UI simple, Apple recommends using a "More" button on the tab bar to fit additional functionality in on a tableview or some other NIB.
Additionally, you could always have another NIB that is hidden unless they hit a certain area or button and then it pops into view for controls, options, etc.