I have an iPad app that has a UISearchBar in its navigation bar. When I enter text in the search bar the results are automatically displayed in a UIPopOverController. That's great except the popover's default size is not wide enough for my needs. Is there a way to set its width?
Apple has done this themselves with Safari's search bar. The popover that displays search results is a good bit wider than the default and they have removed the "Results" title from the popover.
You'd need to set the contentSizeForViewInPopover property of the UIViewController that's being displayed in the popover. I'm not sure how you get to that if it's all automagically happening behind the scenes.
Related
iOS8 Swift UISearchController hides navigationbar
I am facing same problem as in above link. So I have added following line.
self.searchController.hidesNavigationBarDuringPresentation = NO;
But now UISearchController's search bar is shifting down and some blank space is created on search bar's place. If I click cancel button, then search bar is restored to original position.
please help me to fix this issue in iOS 8 using objective-C.
For some reason (I believe this is a bug), UISearchController can place the search bar incorrectly on presentation if its frame coordinates are something other than (0,0).
To work around this, create a UIView where you want the UISearchBar to be and add the UISearchBar as a subview.
You might also be running into this bug: http://openradar.appspot.com/20942583
I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.
I have an app where the navigationBar is implemented according to Apple HIG, so 44px high. Thereunder is a searchBar which is directly under the navigationBar.
The guy designing my app now has created an custom image for the navigationBar which is 64 px high. I already cut the image so that the actual height of the navbar image is 44 px. And added the rest of the image to the tableView background image. Everything is implemented and works correctly except that now my searchBar is scrolling through my navigationBar IMAGE. So technically it is not in the navBar but from a UI design standpoint it is.
I cannot seem to find out how to make sure the space directly under the navigationBar (20px) is not used. It should look as if the navigationBar is 20px bigger to the user.
Hopefully someone can guide me in the right direction, thanks!
I think you have your search bar nested in a UITableView right? You can change your view controller to a subclass of UIViewController instead of a UITableViewController, and then you will be able to add the table view to the controller's view manually and adjust its size whatever way you want.
(Don't forget to let your controller implement data source and delegate protocols and hook it up with your table view.)
Can someone advise me on how I can implement a "touch to return to call" type of UI as seen in the screenshot below?
My intention is to display the bar on top when my application receives a notification.
Any guide or resources on this will be greatly appreciated
There is several ways how you can place something below your status bar.
1. You can add UIView to UIWindow and position it to be under status bar. Set status bar style to black translucent, so the underneath view will be visible. Resize rootViewController appropriately, so it won't overlap your view.
2. Also, you can set wantsFullScreenLayout property of your rootViewController to true, so it'll cover the entire screen and manage view hierarchy inside it. You also need to set status bar style to black translucent.
Alternatively, you can add views above status bar, but I don't think that this is a good user experience. Here is how you can do that: Add UIView Above All Other Views, Including StatusBar
I have a UITabBarController displaying a number of settings-screens in my app. I want them to be shown on just a part of the screen for layout reasons. In fullscreen, the lists become unreadable (too wide), there are just a few controls per page making the page feel very empty, and the tabbar buttons are far away from the content (Fitts law).
Using presentModalViewController with the UIModalPresentationFormSheet style gives me the size I want. I do this on top of an empty background, since in my case it doesn't make sense to display anything behind it. The "real" working area is displayed with another presentModalViewController in fullscreen mode on top of it all.
This works but feels like a hack. One problem is, I can't make the background behind the settings dialog move in the transition to fullscreen with the UIModalTransitionStyleFlipHorizontal style.
TL;DR
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Why don't you try it out?
Create a container view of the size you want the tab bar controller to have.
Create the tab bar controller.
[containerView addSubview:tabBarController.view];