How to resize the search bar so that the index doesn't overlap - iphone

I've been browsing stack overflow and can't find a simple newbie-level explanation for this. I have the following behaviour. When the user clicks the search the index is removed and a cancel button appears next to the search bar. When cancel is pressed, the cancel button is removed and the index reappears.
Does anyone know a simple way to reduce the width of the search bar (text field) by 20-30 pixels on the right. This is the way the contacts app deals with this overlay.
Any help gratefully appreciated. I've built the view in a xib file.

Related

How to show pages index in side when showing the pdf in uiwebview

In the above image, we can see the navigationbar and pages index(side) which can viewed when the user tapped the screen once and will be removed from superview, on another tap.
I added the navigationbar using tap gesture recogniser, but to show the pages index I didn't know what to do and even how to search in google?
Any help will be appreciated.
Since you have added the uiwebviewtag to your question, I guess you are using a uiwebview to read the pdf.
In this case, there is no way to add a sidebar with the page index.
The only way do it is to develop your own viewer using Quartz, or to use an existing library.

How to achieve slideToggle effect similar to facebook "New Stories" button with jQuery?

As you may know not long time ago facebook added several new features. One of them was a "New Stories" button which when clicked expands (with what I guess is a slideToggle effect) and shows new stories.
Here is the button I am talking about:
I would like to know How to achieve same slide / toggle effect and fade in effect that comes in after this button is clicked, with a help of jQuery.
I tried searching for this on internet, but all effects I found were regular slideToggle effects, I mean they started showing div from top and slided down to it's bottom (here is what I mean by regular content http://jsfiddle.net/TwxB4/), where as one facebook uses starts from the bottom of the hidden div and sort of slides to the top of it. (You will see what I mean if you check it on facebook).
Edit: I am only looking for a slideToggle effect and nothing else, I want to be abble to expand and shrink hidden div when user clicks on the link that lunches the effect.
Edit: Here is an illustration of the effect I'm looking for:
This example works the way you described, showing bottom content first:
http://jsfiddle.net/SBLNn/16/
Also full screen view here:
http://jsfiddle.net/SBLNn/16/embedded/result/
They may also do it by having the overflow of the feed hidden, and then setting a negative margin on the inner feed wrapper, then when you click they just animate that negative margin down to 0.
Does this works for you
http://jsfiddle.net/wb7h6/1/
updated version
http://jsfiddle.net/wb7h6/9/ I hope this is what you need
You want slideToggle() I think. See this jsFiddle.

UISearchBar - what is "search results button" for?

(Duplicate of this question, but I figured I could try again, since that one wasn't answered...)
The UISearchBar on the iPhone has an option showsSearchResultsButton. When you turn it on, it shows a button with horizontal lines inside the search bar, and you can implement a callback that will be called when the user presses it.
The thing is, I can't find a single place on the Internet where it says what the intended purpose of this button is. I know I could make it do anything, but I'd like to know what it's actually for. Should it show a history of searches, or all items without filtering, or what?
It's simply to show search results when tapped.
Where Apple uses this is in their iPad App Store application. If you go to the Categories tab you'll see various app categories. Search for an item, you'll get a list of results, and when you press "Done" you are shown the categories screen again. Your previous search term is still listed in the search field, but now the Search Results Button appears in the field. After tapping this, a UIPopOver is displayed, showing a text list of the results from your last search.

Iphone UISearchBar Cancel Button Malfunction

I have a UISearchBar that searches and displays results successfully. If I press the cancel button mid-search, the original table is restored and all is well. If I press the search button that is on the keyboard, the search results are shown, which is great. But THEN if I press the cancel button that is on the search bar (I am using the 'search bar and display controller'), the screen goes back to normal, leaving behind only the search results and not showing the original table.
Any ideas?
Thank you!
I got it - I did not know where I could interact with the cancel button that was built into the search bar but I put code that cleaned out the search table in the -searchButtonPressed and threw that in under the search did its work!

iPhone UI: No edit button for UITableView, bad idea?

I have a UITableViewController which lets the user drill down into different records. On the second level/view, the user can add and edit new records. But, I am not sure what to do, since the back button is on the top left, and I need to put the "Add" button on the top right, so there is no room (keeping to HIG) for the edit button, which would normally go where the back button is. (I am using a tab bar, so can't put it at the bottom.)
Do you think that it is logical, to expect users to know to swipe to delete a record? Or, do I need to have an edit button? If I DO need an edit button, where should I put it if I am following HIG?
Swipe to delete is a firmly established iphone UI interaction, so yes I would be comfortable expecting users to know that. We've run into the same problem a few times, and yeah you only get two nav bar buttons so you've got to make a choice. If you're already using the bottom for a tab bar, I don't see many other options.
I have a similar situation in my app.
When the user taps the edit button I show an extra table cell at the end of my table which lets them add a new record. Not sure if that's feasible in your case.
Maybe add it at the beginning, or insert a button just above the UITableView? You could then also label the button "Add/Edit" to make it clear that that's how they can add new records, although I haven't done that.
Another option would be to have that extra button or table cell always visible.