uinavigationbar

ios7 UINavigationBar stops extending under status bar after a while

折月煮酒 提交于 2019-12-04 01:55:17
First of all - this is NOT a question about navigation bar overlapping status bar (as many others). UINavigationBar (of my navigation controller) is perfectly aligned as I want. The problem is with my navigation bar custom background. Background image (or navigation bar itself) stops expending under status bar randomly (after few seconds after my application starts or when I present / dismiss modal navigation controllers over it). My custom image has proper dimensions for iOS (640x128px). 1. Initial look (desired - custom 640x128px background extends nicely under status bar): 2. After a while

Misaligned title in UINavigationBar since iOS6

独自空忆成欢 提交于 2019-12-04 01:38:21
问题 Ever since iOS 6 I have several problems with using custom styling in my application. I use a custom font and several UIAppearance proxies. A problem I can't get my head around is the misalignment of the title in my UINavigationBar. In iOS 5 everything worked fine and was correctly aligned. Since iOS6 has been released and custom styling is not uncommon I assume this isn't a bug but my misunderstanding of some new change to iOS6. I've searched the documentation for a text alignment method to

iOS8: How do I make statusBar opaque after navigationBar is hidden using hidesBarsOnSwipe?

谁都会走 提交于 2019-12-04 01:34:35
I am building iOS8 app. On my tableview controller, I am using self.navigationController.hidesBarsOnSwipe = YES, to hide the navigationBar on swipe up gesture. It is working nicely, but my statusBar becomes transparent and shows the table content underneath. On storyboard, Status Bar are Top Bar are set to "Inferred" I want to: 1. Keep my status bar opaque 2. Maintain the same color as the navigationBar 3. Table content scrolls underneath the statusBar Thank you. Here is a Swift solution: First, change UITableViewController to UIViewController and add a tableView field. Then, implement your

how to show cancel button of searchbar?

有些话、适合烂在心里 提交于 2019-12-04 00:18:37
I want to hide the Navigation Bar of my page when the user start editing on the searchbar, I also want to show a cancel button. It is done but my cancel button is not accessible when I bring up the UISearchBar Thanks to All. - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { self.navigationController.navigationBar.hidden=TRUE; CGRect r=self.view.frame; r.origin.y=-44; r.size.height+=44; self.view.frame=r; searchBar.showsCancelButton=TRUE; } Objective C - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { self.navigationController.navigationBar.hidden = TRUE; CGRect r =

Can't change UINavigationBar prompt color

喜你入骨 提交于 2019-12-03 23:35:43
I am unable to change the prompt color on my navigation bar. I've tried the code below in viewDidLoad , but nothing happens. self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: UIColor.white] Am I missing something? Is the code above wrong? It seems like you're right about this one. You need to use UIAppearance to style the prompt text on iOS 11. I've filed radar #34758558 that the titleTextAttributes property just stopped working for prompt in iOS 11. The good news is that there are a couple of workarounds, which we can uncover by using Xcode

creating button for popover view anchor at run time

本秂侑毒 提交于 2019-12-03 22:29:51
This may not be possible, but I'm hoping someone will have an idea how to do it. I have an app I'm porting from iPhone only to Universal. On the iPhone, I'm using a Tabbed application. I use three tabs for the normal data to be displayed. I have a forth tab that's only displayed if certain conditions are met. To add the tab, I do: if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { UITabBarController *tabController = (UITabBarController *) self.rootViewController; NSMutableArray* newArray = [NSMutableArray arrayWithArray: tabController.viewControllers]; [newArray

iphone - programmatically change navigation bar button to activity indicator

假装没事ソ 提交于 2019-12-03 22:11:49
I have added a refresh UIBarButtonItem to my navigation bar on my iPhone app. When the user taps the button I'd like the refresh button to change to the animated activity indicator and once the operation (in this case a download) is complete switch the activity indicator back to the refresh button. I have added the refresh button using IB. Then on the button tap I create a new activity indicator and keep an pointer to the original refresh button. Like so: refreshButtonItem = self.navigationItem.leftBarButtonItem; if (activityButtonItem == nil) { activityIndicator = [[UIActivityIndicatorView

Hide Navigation Bar but not the back button

≡放荡痞女 提交于 2019-12-03 21:30:57
i hide my navigation using: [self.navigationController setNavigationBarHidden:YES animated:YES]; But i need to not hide the back button, it's Possible? nevan king is right but you can simply change the background image of the navigation bar or set it to nil. If you set it to nil or provide a transparent BG-image you would achieve the effect you need. For iOS >= 5.0 you could simply set the appearance: if([navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) // needed if iOS older than 5.0 is also supported [navigationBar setBackgroundImage:nil forBarMetrics

How to disable navigationBar animation?

随声附和 提交于 2019-12-03 21:23:34
I have two UITableViewControllers such that when I click next on the first UITableViewController, the second UITableViewController gets pushed on the navigation stack and animates the transition like normal. I'd like to make it so when I push next, only the views animate, and the navigation bar doesn't (stays the same). I've gotten very close to doing this with the code below: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; CATransition *navTransition = [CATransition animation]; navTransition.duration = .5; navTransition.timingFunction = [CAMediaTimingFunction

UINavigationBar: intercept back button and back swipe gesture

萝らか妹 提交于 2019-12-03 20:14:48
I have a UINavigationBar that intercepts the back button tap that alerts the user if there are unsave changes. This is based on the solution presented in UINavigationController and UINavigationBarDelegate.ShouldPopItem() with MonoTouch using the UINavigationBarDelegate protocol and implementing - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item; Now, iOS7 has introduced the swipe-to-go-back gesture, and I'd like to intercept that as well, but can't get it to work with the solutions I've found so far, namely using [self.interactivePopGestureRecognizer