Brining the UISearch bar from any position: iPhone - iphone

Im creating this app for the iPhone and what I want to do is bring up a hidden search bar from any position of a view when scrolling. I currently have it sitting on top of the view.
I want to be able to invoke the hidden search bar from any postion as the user scrolls. The search bar can ONLY be used from the top position as of right now. If any one can point me to the right direction that would be great.

I recommend putting UISearchBar above your UIScrollView via [view insertSubview:searchBar aboveSubview:scrollView]. Then you can just call [searchBar setHidden:NO] and your search bar will appear on the screen.

Related

enabling scroll view scroll to top

I have a scrollview in a subview.How to enable setScrollsToTop on status bar click?
I have tried [DetailView.scrollView setScrollsToTop:YES]; and [scrollview setScrollsToTop:YES];
Still doesn't work. DetailView is my subView.Any ideas??
iOS automatically decides what to do on status bar click based on several factors - like currently active scroll view to position onscreen to position in the view hierarchy.
Setting scrollsToTop only tells iOS that you are OK with this behavior.

How to make tableview's content displayed under a transparent navigation bar?

How to make tableview's content displayed under a transparent navigation bar?
Like this:In "Photos" app, albums displayed under navigation bar.
Special thanks
If you use _rootNavigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent; then set correct tableview frame thats it. If you are in xib dont forget to simulate the translucent navigation bar.
One way I have found to accomplish this is by shifting your tableview's superview up to have the origin at {0, 0}. However after researching more several people have said altering the superview (UIViewControllerWrapperView) is a bad idea. However I also have not found any information on why just changing the frame would create problems. I am shifting the superview right now and haven't found any problems related to it yet.
Might be you can set it like this:
[navigationBar setAlpha:0.5f];
For making the navigation bar transparent alone, you can check this post, How to make a Navigation bar transparent and fade out like in the photo app in the iPhone
Also check this How to set the transparency color for Toolbar and Navigation bar using MonoTouch?
I am not sure whether you can add the table view behind the navigation bar. You might have to add it as a subview of self.parentViewController.view.
Another way to do this is by hiding navigation bar and using a transparent tool bar in place of that. This can be added on top of the current view. The only problem is with the back button. You might have to use custom button for that.

the scroll bar is hidden behind the keyboard

I have a UITableViewController with a search bar. When I touch the screen to start the search, I hide the UINavigationBar and show the scope bar search to optimize the space.
For the TableView not hide behind the keyboard and search bar, I add header and footer to the table with their respective heights.
Everything working correctly. But the scroll bar is still hiding behind the search bar and keyboard.
Any suggestions to solve this or some other way to do this whole mechanism?
Resize the table view's frame by subtracting the height of the keyboard.

Is it possible to cover UIStatusBar with a view while maintaining scrollsToTop functionality?

I want to display a message to the users of my app in the UIStatusBar, but I'd like to maintain the scrollsToTop functionality so a user can tap on the statusbar and scroll a tableView up to the top.
I've looked into adding a UIWindow on top of the current status bar as in this question: Add UIView Above All Other Views, Including StatusBar
But it disables the touches to the status bar.
Note: I've seen several apps that use the statusBar area to display messages such as the "Evernote" app.
Thanks for the help!
Have a look at https://github.com/myell0w/MTStatusBarOverlay. By pressing it it can be toggled to not cover the whole status bar and then you can toch the status bar and get back the scroll-to-top feature.
Here is a screenshot, the left side shows the expanded version, the right side the shrinked one:
Are you hiding the statusBar ? It's unwise to keep it there but draw into its position, because in different countries, with different mobile operators, the statusBar's elements have a little different positions. I've seen app drawing there over status icons. Ugly!
So I guess you want to add a subview at the position of statusBar. Why don't you intercept touch events in that view and send your tableView a message to scroll to the top ?

iPhone SDK: Examining view size within UINavigationController

My application has a tab bar, and in one tab I have a navigation controller.
I want to find the position of the center of the view that appears between the navigation bar and tab bar, so that I can display a UIActivityIndicatorView right in the middle of the view when stuff happens.
However, I'm getting different values of self.view.bounds.size depending on where I am in the navigation hierarchy. At the top level, it tells me 320x460 but it's 320x367 in deeper levels.
320x367 is the size I'm expecting (and confirmed in IB by the size inspector). So why am I seeing different on the top level only?
Answering own question by approaching the original problem a different way.
I was trying to create a UIActivityIndicator using initWithFrame, passing it coordinates for the center of the current view, calculated from its bounds.
However, this is unnecessarily complicated. I can simply set
activityIndicator.center = self.view.center;
to align the activity indicator right in the middle of the main view.