uinavigationbar

Can't set titleView in the center of navigation bar because back button

筅森魡賤 提交于 2019-11-27 05:24:12
问题 I'm using an image view to display an image in my nav bar. The problem is that I can't set it to the center correctly because of the back button. I checked the related questions and had almost the same problem earlier that I solved, but this time I have no idea. Earlier I solved this problem with fake bar buttons, so I tried to add a fake bar button to the right (and left) side, but it doesn't helped. - (void) searchButtonNavBar { CGRect imageSizeDummy = CGRectMake(0, 0, 25,25); UIButton

Background image for navigation view

微笑、不失礼 提交于 2019-11-27 05:15:05
问题 I am having problems with properly displaying background image of navigation view. Here is the pic: Here is the code: - (id)initWithStyle:(UITableViewStyle)style { if (self = [super initWithStyle:style]) { UIImage *image = [UIImage imageNamed: @"bg_table_active.png"]; UIImageView *imageview = [[UIImageView alloc] initWithImage: image]; UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Settings", @"") style:UIBarButtonItemStyleDone target:self action:

Add subtitle under the title in navigation bar controller in Xcode

笑着哭i 提交于 2019-11-27 05:08:50
问题 So I'm wanting to add a "subtitle" under the title in the navigation bar in navigation controller. Mostly everything I look up so far wants me to use CGRect. I don't know a whole lot what that is and it sounds like its wanting me to create an entire new view which is not what I am wanting to do. My question is, is there a dot method to adding a subtitle view easily? The closest thing I found was posted on stack overflow and here is the link: Create a subtitle in navigationbar Apparently last

iOS7 - Change UINavigationBar border color

隐身守侯 提交于 2019-11-27 05:08:35
问题 Is it possible to change the grey border-bottom color of the UINavigationBar in iOS7? I already tried to remove to border, but this is not working: [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; Thanks! 回答1: This will help you :) [self.navigationController.navigationBar.layer setBorderWidth:2.0];// Just to make sure its working [self.navigationController.navigationBar.layer setBorderColor:[[UIColor redColor] CGColor]]; 回答2: You are removing the shadow but not the border

Change color of Back button in navigation bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 05:00:59
问题 I am trying to change the color of the Settings button to white, but can't get it to change. I've tried both of these: navigationItem.leftBarButtonItem?.tintColor = UIColor.whiteColor() navigationItem.backBarButtonItem?.tintColor = UIColor.whiteColor() but no change, it still looks like this: How do I make that button white? 回答1: You can change the global tint color in your storyboard by clicking on an empty space on the board and select in the right toolbar "Show the file inspector", and you

how to create back button in navigation bar

别等时光非礼了梦想. 提交于 2019-11-27 04:40:19
问题 I have 2 page. first is tableView and second is view when I to click on any cell go on to next page (view) in way modal segue. I want add back button in next page of navigation bar . this is my code in view page : ViewController.m - (void)viewDidLoad { [super viewDidLoad]; self.lable.text = obji.Name; self.lable2.text = obji.Descript; UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStyleBordered target:self action:@selector(Back)]; self

Checking if a UIViewController is about to get Popped from a navigation stack?

有些话、适合烂在心里 提交于 2019-11-27 04:17:00
问题 I need to know when my view controller is about to get popped from a nav stack so I can perform an action. I can't use -viewWillDisappear, because that gets called when the view controller is moved off screen for ANY reason (like a new view controller being pushed on top). I specifically need to know when the controller is about to be popped itself. Any ideas would be awesome, thanks in advance. 回答1: I don't think there is an explicit message for this, but you could subclass the

IOS7 : UIScrollView offset in UINavigationController

拟墨画扇 提交于 2019-11-27 04:09:01
问题 I'm currently migrating my app on ios 7 and I've been stuck for hours on the new navigationcontroller/bar management. Before, when we had a navigation controller, we had a snippet like this : UINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:[[MainViewController alloc]init]]; In interface builder, we had the choice to set an existing navigationbar for the view and everything match the content of the real view. OK so now, i have no clue of how to

How to add navigation interface after create a tab bar controller programmatically (Swift)

荒凉一梦 提交于 2019-11-27 03:48:17
问题 How do I add a navigation interface programmatically on Swift after I created a TabBarController on AppDelegate/didFinishLaunchingWithOptions . Here are my current codes: self.window = UIWindow(frame: UIScreen.mainScreen().bounds) let tabBarController = UITabBarController() let purchaseViewController = PurchaseViewController(nibName: "PurchaseViewController", bundle: nil) let financeViewController = FinanceViewController(nibName: "FinanceViewController", bundle: nil) tabBarController

Hiding UITabBar when pushing a UIView

 ̄綄美尐妖づ 提交于 2019-11-27 03:23:21
I have a UITabBarController where the default view controller is a UINavigationController . I want to be able to hide the UITabBar of the UITabBarController when I push a certain view in the UINavigationController . I've tried adding: delegate.tabBarController.hidesBottomBarWhenPushed = YES; in my UINavigationController before I push the view, but that doesn't seem to do the trick. Any tips on what I should be doing or if it's even possible? Thanks in advance! This is better: viewController.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController:viewController animated