How to create a toolbar in a TableView with a Label? - iphone

I would like to add a toolbar with a label entitled "Save your search?" on the left and a button "Save" on the right that triggers a specific action when tapped. How could I do that programmatically, especially I want this Toolbar to show up only when a particular View is loaded on a screen but not on every view.
Also, I want the toolbar to have a static image as background. "Save" button will also have a static image for background

Just to check; why do you need to add this toolbar of sorts onto a TableView? Depending on how you've set things up; and specially seeing that you need to conditionally hide/show this toolbar, might be easier to add it outside the tableView (just above it I guess).
Seeing as you need to hide/show this toolbar at will; guess you can simply use a UIView for it and add the UIButtons on top as subviews; --> declare it as a property in the .h file so that it can be freely accessed in the .m file whenever you need to hide / show it.
Did you need help on some specific issue related to this perhaps; or would this serve as a goo enough starting point?

Related

UIBarButtonItem image/glyph in Standard UIButton

I'm trying to create a 'Refresh' button containing the standard UIBarButton refresh system glyph, which, when tapped, will animate a custom view, then fire another selector to call the intended refresh action.
I know I could do this with images and two inner views added to a custom view, but is there any way to do it with the standard glyphs from UIBarButtonItem? Are they available at all for UIButtons?
When I was creating my iOS application, I wasn't able to find a "refresh" button for the UIBarButtonItem. I had to take a Rounded Rect Button and place it in the top right hand corner and create a custom image to overlay onto it.
Edit: You can find it in IB. When you add the UIBarButtonItem, select it and then select the attributes inspector tab. Click the Identifier drop down and within that there is a selection to change the button to look like the system refresh button.

Image Slider to my iPhone application

I need this kind of component to my iPhone Application. How could I Added to this to my project.
after i click that black color I need to animated it to left side and show next one.. like that
Try a tableView with one row and one section. Then the action of clicking on the row can trigger the delegate method of the tableView and use that to do whatever you like.
Alternately, you can make this a button with a custom view and swap out the view each time the user taps it.

iPhone UIActionSheet with UISwitch and UITextField

I'm just looking for advice with this as I have no idea where to start but I think a UIActionSheet is probably best.
What I'd like to have is a pop up window (in my head I picture it as being translucent and dark gray). It will not take up the whole screen and the view underneath will still be visible.
In the pop up section there will be a textfield (with several lines) and underneath this there will be a number of UISwitches.
The pop up will be scrollable and will end with OK/Cancel buttons at the bottom.
Like I said, I really have no idea where to start with this but any advice is more than welcome!
A UIActionSheet is probably not what you are after in this case (although you may want a similar look and feel). Think of an action sheet as a traditional modal OK/cancel/Yes/No type dialog box:
Use the UIActionSheet class to present the user with a set of alternatives for how to proceed with a given task.
From the sound it of it, you need to create a UIView in InterfaceBuilder with a semi-transparent background and various child controls (UISwitches and UITextFields). You create your view using the XIB you have configured and add it as a subview of your UIViewController's view. If you want to mimic the animation you get from an action sheet, you can do that with an AnimationBlock.

Add extra button to ABPersonViewController

Im working on a small app that displays contact and biography details.
You can see two screenshot here: contactDetails, biogDetails.
At the moment I have an Action button on the right hand side of the NavigationBar that displays an ActionSheet where the user can perform various actions like:
"add to favorites"
"update data",
"Biog Details", etc.
I feel the "Biog Details" is not an action as the others and I would like to display it on a different way.
I was wondering if there is a way to add an extra custom button to the PersonViewController.
I dont really want to create a lookalike of the PersonViewController, because i would lose functionality that I can replicate with the public APIs.
The other option could maybe be to have a segmentedController on the center of the NavigationBar that would switch between the two viewsControllers. How could I do that?
Im open to ideas.
Thanks,
The only way you'll be able to add that extra button is if you use the UIToolBar instead of the UINavigationBar.
If you decide to use the UISegmentedControl you'll also have to use the UIToolBar.
You can duplicate the UISegmentedControl on both views but with the appropriately selected segment on either.
Or you could use one "base" view, add the other two as subviews and hide/unhide the appropriate view depending on the segment that is selected. This would however mean that you change the position of the subviews (by adjusting their rect parameters) so that they appear just below the UIToolBar

iPhone SDK allow touches to affect multiple views

I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction itself while the main view controls the display of next and previous panes with the buttons. Here is my dilemma, because the pane fully covers the main view it wont allow for the user to tap the buttons on the main view! So once a pane pops up you cannot change it via the buttons! Is there a way to allow touches through transparent parts of a view, or if not how in the world do I achieve this?!
I cannot pass touchesBegan or any of those methods from the pane to the superview because all of the button touch methods are created in the xib file.
I cannot insert the pane under the control panel because then you wouldn't be able to interact with the pane. And as far as I know theres no way to pass touch events to every single pane within the paneHoldingArray that belongs to the main view
I cannot add the command buttons inside of the pane because I want to be able to replace the command button's image with a thumbprint render of the next/previous pane.
I've been stuck on this for a very long time, please somebody help me out with a fix action or a new way to re-engineer the code so that it will work!
If you want the buttons to capture events, then layer them above the pane. You say you cannot put the control panel above the pane, so break the buttons out into another view that you can put above the pane. If you want the buttons to appear under other views, then make some completely transparent custom buttons to handle you actions that you can layer on top.
I don't know what you mean by the button touch methods are created in the xib file, but in general you cannot effectively pass touch events around. You must organize the view hierarchy so that the views you want to receive events are logically on top. However, nothing says that the views on top have to be opaque or even visible.