uinavigationbar

iOS 7: Custom container view controller with UINavigationController as a child view controller

杀马特。学长 韩版系。学妹 提交于 2019-12-06 07:48:26
问题 I would like to write a custom full-screen container view controller with the intention of putting a UINavigationController in it as a child view controller. The view of the UINavigationController will fill up the view of the container view controller so that it looks like the UINavigationController is the root view controller. (One would want to do something like this to, say, create the sliding sidebar menu UI popularized by Facebook.) What I've done works EXCEPT there is a glitch when

UINavigationBar frame height returns 44.0 but is actually 64.0

三世轮回 提交于 2019-12-06 05:57:21
I have a UINavigationController in a storyboard which is not using AutoLayout. With the status bar visible the actual height of the UINavigationBar is 64.0 and yet when I log self.navigationBar.frame.size.height I get 44.0. How do I get the actual height of the UINavigationBar? I'm using Xcode 7.3 and the storyboard builds for iOS 6. The height of the UINavigationBar is 44 . The reason you´re getting 64 is because of your status bar is visible and it has a height of 20 . Update: To calculate the height you could: let height = Double(UIApplication.shared.statusBarFrame.height) + Double(self

After NavigationBar Hide on Swipe, Cells appear between HeaderCell & Status Bar for a second

无人久伴 提交于 2019-12-06 05:56:42
Edit: I tried adding in AppDelegate DidFinishLaunch.. let view: UIView = UIView.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.size.width, 25)) view.backgroundColor = UIColor.redColor() view.alpha = 1 self.window!.rootViewController!.view.addSubview(view) After I changed the Status Bar to red, I prevented it going under status bar, but I realised that it wasn't just the Status Bar and there was something going on with the Navigation Bar while it gets swiped away. The content cells get shown until 1 seconds after NavBar gets swiped away. After 1 seconds, everything seem nice and no

Add title and image to navigationbar

南楼画角 提交于 2019-12-06 05:40:02
问题 I need so set the name of the UIViewController and an image to the navigationBar. So far I am able to display the image, but the title is of course missing. // show image UIImage *image = [UIImage imageNamed: @"bar_icon.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage: image]; imageView.frame = CGRectMake(0, 0, 40, 40); self.navigationItem.titleView = imageView; [imageView release]; Thanks for your help, BR, doonot 回答1: // show image UIImage *image = [UIImage imageNamed: @

iOS 11: Height of UINavigationBar for large title (mimic Apple Music App)

梦想与她 提交于 2019-12-06 04:53:16
问题 I'm trying to mimic the look of UINavigationBar as used by the Apple Music App (the date is shown above the large title). I know that the Apple Music App doesn't use the standard UINavigationBar of ios11 but a header view is UICollectionView . I also want to use the standard UINavigationBar of ios11 because of the resizing feature for title text. I'm able to add the custom date label to view hierarchy of the large title view , my code as shown below: self.title = "Large Title"

UINavigationBar refuses to show in Modal View Controller

北慕城南 提交于 2019-12-06 04:42:54
I am loading a Modal view controller using the following code in my RootViewController: [self.navigationController presentModalViewController:accountViewController animated:YES]; In the accountViewController xib file, I have set a navigation bar. My MainWindow.xib and RootViewController.xib also have the navigation bar setup correctly. Additionally, my app delegate has setup the navigation controller (I assume) correctly: UINavigationController *aNavigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController]; self.navigationController =

Navigation bar with large title shrinks when webview is loaded

落花浮王杯 提交于 2019-12-06 04:40:45
问题 In viewcontroller, I'm loading a webview(WKWebview) with large navigation title enabled. The problem is its showing the large navigation bar and title perfectly before the webview gets loaded once the webview got loaded it shrinks to normal. Anyhelp would be appreciated. Thanks in advance...! 回答1: Swift4, Swift5 : The reason of this issue is your navigationBar height is changing when you webView starts loading the page. so using viewLayoutMarginsDidChange() we can change navigationBar height.

UISearchBar in UINavigationBar can't add UIBarButtonItem

Deadly 提交于 2019-12-06 04:38:06
I'm trying to add a UISearchBar to a UINavigationbar using self.searchDisplayController.displaysSearchBarInNavigationBar = YES; The UISearchBar gets added quite well into the UINavigationBar, but the left/right UIBarButtons are gone. I just can't figure out how to add them. Andy ideas or examples on this? Dumb error from mine. When using self.searchDisplayController.displaysSearchBarInNavigationBar = YES; You need to use self.searchDisplayController.navigationItem to add the UIBarButtons. Now it is working properly. For others viewing this thread, elaborating Ben's answer is what worked for me

Center elements vertically inside UINavigationBar with custom height

落花浮王杯 提交于 2019-12-06 04:35:58
问题 I'm developing an iOS 6 and 7 app that requires the navigation bar to be taller than the usual 44/64 pts I've searched high and low and so far it seems the cleanest solution is to use a category (or subclass) and implement the - (CGSize)sizeThatFits:(CGSize)size method to return a different size. This works fine in just making , however doing this causes all the items inside to rest at the bottom of the navigation bar, while I'd like to have them centered. I have tried using the Appearance

IOS - Swift - adding target and action to BarButtonItem's customView

守給你的承諾、 提交于 2019-12-06 03:25:13
问题 I'm creating a custom view, with a uiimageview as a subview. I'm then using that custom view in my navigation bar as the rightBarButtonItem. This works to display the proper icon in the proper location, but for whatever reason the function I define in "action" is never being called, so the segue isn't performed when I tap on the rightBarButtonItem. Oddly enough if I do NOT insert a custom view, but instead comment that bit out and just set a title, target, and action for rightItem then the