uinavigationbar

Back button not appearing on UINavigationController

痞子三分冷 提交于 2019-11-30 21:49:41
I have a UINavigationController setup in my AppDelegate: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Add the navigation controller's view to the window and display. [self.window addSubview:navigationController.view]; [self.window makeKeyAndVisible]; return YES; } In my RootViewController I am pushing another view onto the stack: //Show the deals DealViewController *dvc = [[DealViewController alloc] initWithNibName:@"DealViewController" bundle:nil]; [self.navigationController.navigationBar setHidden:NO]; [self

Change UINavigationItem colour

独自空忆成欢 提交于 2019-11-30 21:49:39
I need to set custom colors to my UINavigationBar buttons. I'm doing the following thing(RGB func is a define): - (void)viewWillAppear:(BOOL)animated { for (UIView *view in self.navigationController.navigationBar.subviews) if ([[[view class] description] isEqualToString:@"UINavigationButton"]) [(UINavigationButton *)view setTintColor:RGB(22.0,38.0,111.0)]; } Everything looks fine on app load. after leaving the view and getting back the color returns to default. Secondly I need to set the same colour to UISegmentedControl to a pressed button. Nikunj Jadav Here's one way: [[theNavigationBar

Move UINavigationController's toolbar to the top to lie underneath navigation bar

北战南征 提交于 2019-11-30 20:49:35
When you create a UINavigationController , you can reveal its default hidden UIToolbar via setToolbarHidden:animated: (or by checking Shows Toolbar in Interface Builder). This causes a toolbar to appear at the bottom of the screen, and this toolbar persists between pushing and popping of view controllers on the navigation stack. That is exactly what I need, except I need the toolbar to be located at the top of the screen. It appears that's exactly what Apple has done with the iTunes app: How can one move UINavigationController 's toolbar to the top to lie underneath the navigation bar instead

iOS 11 Navigation TitleView misplaced

限于喜欢 提交于 2019-11-30 20:10:03
I have an iOS app in which I am setting a custom navigation title view. It was working fine till iOS 10, but in iOS 11 the navigation title view is misplaced. Here is the screen shot for iOS 10 - Here is the screen shot for iOS 11 - As you can see in the screen shots that when I run the code on iOS 10 the title view appears to be fine. But the same code on iOS 11 shifts the title view down by some pixels and it gets cut. This is how I am setting the title view - navigationItem.titleView = MY_CUSTOM_TITLE_VIEW I tried many things and searched for many solutions but nothing is working. Here's

AutoLayout issue Swift 3.0

耗尽温柔 提交于 2019-11-30 19:49:06
问题 I have already Autolayout this screenshot using.I want when i click textView ,textView will always just above Keyboard and also i am using custom NavigationBar .I already used IQKeyBoardManagerSwift It is working but my NavigationBar also moves up I want my NavigationBar to be stick at top if i click textView.Any Solutions to this. thanks in advance 回答1: Swift 3.0 :- Drag your UITextView in a contentView(UIView) , Create IBOutlet of bottom constraint of contentView i.e bottomConstraint .

UISearchDisplayController hiding navigation bar

≯℡__Kan透↙ 提交于 2019-11-30 19:28:52
问题 I am seeing a weird situation. I have put a search bar in the navigation bar and have linked a UISearchDisplayController with the search bar. Now, the search display controller tends to hide the navigation bar when the user clicks on the search bar (therefore, hiding the search bar also). In order to counter that, I subclassed UISearchDisplayController and implemented the following code :- - (void)setActive:(BOOL)visible animated:(BOOL)animated { [super setActive: visible animated: animated];

Setting navigationController.hidesBarsOnSwipe = YES never shows my navbar again

浪子不回头ぞ 提交于 2019-11-30 18:06:51
When i set navigationController.hidesBarOnSwipe = YES and try swiping in the webView shown the navigation bar is hidden, but it will never show up again, when i try swiping to get it back. My ViewController is listening to the swipe event : [self.navigationController.barHideOnSwipeGestureRecognizer addTarget:self action:@selector(swipe:)]? But this selector is in fact never called again after the navigation bar is hidden because of the Swipe. Anyone implemented hidesBarOnSwipe ? Is it a known bug or is it as designed that it won't show the navigation bar after hiding it. Before: After: I have

UIAppearance setTranslucent error: Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter

て烟熏妆下的殇ゞ 提交于 2019-11-30 17:28:45
Trying out iOS 7 did: [[UINavigationBar appearance] setTranslucent:NO]; Got crash and error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter:' *** First throw call stack: (0x16ad9b8 0x142e8b6 0x16ad7ab 0x72163d 0x724c34 0x169daca 0x169d8de 0x6c09 0x228ea9 0x2296e9 0x22ab5e 0x240a6c 0x240fd9 0x22c7d5 0x35a4906 0x35a4411 0x16293e5 0x162911b 0x1653b30 0x165310d 0x1652f3b 0x22a2b1 0x22c4eb 0x6f3d 0x1d0d725) libc++abi.dylib: terminating with uncaught exception of type

UINavigationController with custom shape navigation Bar

五迷三道 提交于 2019-11-30 17:21:48
问题 I'm trying to create a custom UINavigationBar with a custom shape, like this (ignore transparency) As you can see, this UINavigationBar has a custom shape and I'm trying to replicate it. Looking around I found this response, where it explains the firsts steps I followed. 1) I created a subclass of UINavigationBar called CustomNavigationBar. 2) I overrode the sizeThatFits method like this: - (CGSize) sizeThatFits:(CGSize)size { return CGSizeMake(320.0, 70.0); } 3) And here is where I'm lost...

How to add several UIBarButtonItems to a NavigationBar?

会有一股神秘感。 提交于 2019-11-30 16:54:24
问题 I want to draw multiple buttons on a UINavigationBar . These will be either on right side or left side. 回答1: I did one example in which I had two buttons ( i.e. Edit and +) on Right side of NaviagationBar. 1) You have to create one NSMutableArray (i.e. "buttons" in example) and add UIBarButtonItem (i.e. bi1 and bi2 in example) to the NSMutableArray (i.e. buttons). 2) Add NSMutableArray (i.e. buttons in example) to toolbar(i.e. UIToolbar *tools in example). 3) Add toolbar to NavigationBar.