uinavigationbar

Custom styling of UINavigationBar not working properly

你。 提交于 2019-12-25 05:24:12
问题 I am using this code to set custom background image for all UINavigationBars. The problem is that the final image does not appear to be retina size. I researched UINavigationBars are 640x88px. Thats exact dimensions of my UINavigationBar.png however I only see 320x44px on the iPhone Sim(retina) and my iphone 4 which is also retina. The code that sets the image: UIImage *background = [UIImage imageNamed:@"UINavigationBar.png"]; [[UINavigationBar appearance] setBackgroundImage:background

Navigation Bar and Search Controller

孤街浪徒 提交于 2019-12-25 05:17:17
问题 I want my navbar and search bar to be the same color. I also want to get rid of the hairline between them but that seems a minor issue compared to the first one. The navbar attributes are set this way: self.navigationController?.navigationBar.barTintColor = ColorHelper.sharedInstance.LightPink() if let navBarFont = UIFont(name: "HelveticaNeue-Light", size: 25.0) { let navBarAttributesDictionary: [String: AnyObject]? = [ NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName

How do I add back button to UINavigationBar programmatically?

时光总嘲笑我的痴心妄想 提交于 2019-12-25 04:05:21
问题 I have a UINavigationController and when I push one of my views, I have a UINavigationBar on top that I made an ivar for and connected it. Now what I need is that button that is like half square and half arrow on the left of the bar. How would I do this programmatically? All I need it to do is say back and do my back action when it is clicked. How would I do this? Thanks! 回答1: If you're using a UINaviationController, then each view controller that you push onto it does not need it's own

How can I make the navigation bar scroll along with my webpage?

夙愿已清 提交于 2019-12-25 03:53:51
问题 How can I make the navigation bar hide as the user scrolls? I'm trying to implement a browser like the Safari Mobile app. note: I'm using UIWebView and not a UIScrollView. 回答1: The standard approach used to be to add your view as a subview of the webview, and change the webview's contentInset property to shift everything in the webview downwards. I'm not sure if that still works with iOS 4.3. Alternatively, if you search on SO, you'll find lots of questions the same as this one, with a

Detect and handle, or override, clicks on a navigation bar

为君一笑 提交于 2019-12-25 03:15:24
问题 I have an app where I've pushed two items onto the navigation bar. The top item, which ends up as a 'back' button, should have the function to jump all the way back to the start page, which is a list of web news. The other one simply displays a logo. The boss wants a navigation bar look and feel but with a simple function, so the user can click around the news site, but always be able to jump to the news list page with just the one click. Is the only option to create a fixed navbar with two

UINavigationBar blur iOS 7.1 and above

こ雲淡風輕ζ 提交于 2019-12-25 03:07:27
问题 How to have navigation bar blurred like on the first image here. I did some research, but seems tint color and translucent does not apply for this needs. I am using iOS 7 and iOS 8 The problem that I have table under navigation bar and it change content dynamically, so the blur effect should be changed as well each time I scroll table. 来源: https://stackoverflow.com/questions/29129845/uinavigationbar-blur-ios-7-1-and-above

iOS 7: How to force navigation bar of UINavigationController to be laid out as if status bar is showing even when status bar is hidden

断了今生、忘了曾经 提交于 2019-12-25 02:03:02
问题 Is there a way to force the navigation bar of a UINavigationController to be laid out as if the status bar is showing even when the status bar is hidden? My motivation is to prevent the navigation bar for shifting when a navigation controller presents a view controller that returns YES for prefersStatusBarHidden. An example of this is when you look at an attached image in an email in the Gmail app. 来源: https://stackoverflow.com/questions/22586361/ios-7-how-to-force-navigation-bar-of

Navigation Controller Error

≡放荡痞女 提交于 2019-12-25 00:23:06
问题 I have a navigation controller and I want the title to have a custom font. I have tried to do this but when it runs I get Thread 1: EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP.subcode=0x0) Here is my code. import UIKit class PriceCheckSpreadsheetViewController: UIViewController { @IBOutlet weak var SpreadsheetView: UIWebView! @IBOutlet weak var Loading: UIActivityIndicatorView! @IBOutlet weak var BackButton: UIBarButtonItem! @IBOutlet weak var ForwardButton: UIBarButtonItem! @IBOutlet weak var

Right button not showing after add left button and title

夙愿已清 提交于 2019-12-25 00:13:28
问题 I want to design naviation view like below image: I am adding this code func setupUpHomePageNavigation(title:String, subtitle:String) { let back_button = UIBarButtonItem(image: #imageLiteral(resourceName: "ic_logo"), style: .plain, target: self, action: #selector(self.btnKbImageClicked)) self.navigationItem.leftBarButtonItems = [back_button] let space = UIBarButtonItem(barButtonSystemItem: .fixedSpace, target: nil, action: nil) space.width = 0.0 let one = UILabel() one.text = title one

putting a custom button on a nav bar in ios6 not working

人走茶凉 提交于 2019-12-24 21:57:14
问题 I have researched this a lot and have used a couple of different approaches. This code is located in my ViewController.m : 1)1st Approach UIImage *settingsimage = [UIImage imageNamed:@"gearicon"]; UIBarButtonItem *settingsBarButton =[[UIBarButtonItem alloc] initWithImage:settingsimage style:(UIBarButtonItemStylePlain) target:self action:@selector(switchpages)]; self.navigationItem.leftBarButtonItem = settingsBarButton; this code executes without any errors, but no button appears! 2) 2nd