UIBarButton differences between View and tableViewControllers? - ios4

I have a tab bar iPhone application.
Tab bar #1 has a table view controller. It pushes a detail screen onto the stack.
On the top right hand corner there is a UIBarButton that calls and action sheet. This
is all built programmatically through code and all works fine.
Tab bar #2 calls a table view controller than then loads a map view. The map view annotation callouts then open up a detail screen. On this screen, I'd like a UIBarButton. So far, I cannot get this to work. The button does not show up.
Any ideas why?
Thanks,
J

UIBarButtonItem is not inherited from UIView.so u can't.
why dont u just use UIButton with Custom picture .
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIBarButtonItem_Class/Reference/Reference.html

Related

Is there a way to separate the design window in dreamweaver and put in on my second screen?

Is there a way to separate the design window in Dreamweaver and put in on my second screen.
So then i can have the code view on my main screen and design view on the second screen.
Thanks in advance
Just expand the window into both screens. To do this you need to restore the window down, grab the corner of the window, and expand to the second screen. That's what I do with it so that my Code View is on my left monitor and Live View is on my right.

Tabbarcontroller,NavigationController and viewController

I have made a Tabbar based application in that i have three tab.
each of tab has NavigationController..
In one of the tab (lets take in the 1st tab), i have a UIButton in that FirstViewController that is rootViewController of NavigationController..by clicking on button i navigate to the secondViewController...
Now i switch to second tab. and again switching back to 1st tab i got secondViewController open.
but i don't want that....i want to go on the FirstViewController while switching back to 1st tab...
is it possible ???
if yes then can any1 help me to solve it out??
any Help will be appreciated...
That is the default behavior of UITabbar controller,so that the user can go back to the view controller which he had left from earlier.You cannot change it.

Selecting and Deselecting segment on UISegmentedControl?

I've added a segmented control as the right bar button item of my navigation bar. The control has two segments and I'm attempting to use the control as bar button items. So I was wondering haw can I deselect a selected segment once the user preses it. I've already tried setting the selectedSegmentIndex property to -1 when the action method is called but that is preventing the segment from even being highlighted. Any idea on how can can get the segments to behave like bar button item?
do segmentedControl.momentary = YES; during setup or if using IB, select the Momentary checkbox in the Attributes Inspector.

Change "back" NavigationItem text in Monotouch?

Is it possible to change the "Back" button text in a NavigationItem? At present, the caption of the back button assumes the title of the previous layer in the navigation stack, which is expected.
However, the NavigationItem's LeftBarButtonItem can be changed using code such as this:
UIBarButtonItem backButton = new UIBarButtonItem("Back", UIBarButtonItemStyle.Plain, null);
myNewView.NavigationItem.SetLeftBarButtonItem(backButton, true);
This works and the back button is displayed as expected, but the button is a square and does not navigate back to the previous layer as expected. I'm guessing that the correct event needs to be assigned to it, but I have no idea what it should be.
How would one go about ensuring that the new UIBarButtonItem has the correct event and arrow shape?
Note: I have also tried re-using the `LeftBarButtonItem' as suggested in this SO question, but I still don't know how to customize the button caption. I am probably just missing the obvious.
Thanks!
Set the title on the previous viewcontrollers navigationitem. I answered this before and will look up the link.
Ah, yes: Separate title in NavigationBar and navigation buttons

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

Resources