uinavigationbar

UINavigationBar with two buttons on the left

∥☆過路亽.° 提交于 2019-12-19 10:09:00
问题 I know that on stackoverflow there are many similar questions but mine is a little different. I'll show this with images, because it's easier to understand. Using this code I took from here, I had this result: It's easy to see that the second button isn't all on the screen. I tried to but negative numbers in the UIToolbar frame but they don't work. I don't need any title there, only a way to move these buttons to the left. 回答1: Here is a different approach. I created a custom segmented

iOS 13: threading violation: expected the main thread

烈酒焚心 提交于 2019-12-19 09:42:22
问题 The app is being crashed when trying to hide the navigation bar for a viewcontroller only for iOS 13 users. I got the crash on Crashlytics of Fabric which titled as below, Fatal Exception: NSInternalInconsistencyException threading violation: expected the main thread The app is being crashed on this line of viewWillAppear method, self.navigationController?.isNavigationBarHidden = true To hide the navigation bar on the viewWillAppear method of UIViewController, I am using below code, override

iOS 5 [UINavigationBar appearance] setBackgroundImage does not do work

天涯浪子 提交于 2019-12-19 08:09:07
问题 I created a new test iOS5 project in Xcode 4.2 Build 4D199 and tried to set the appearance of the UINavigationBar as described above, but nothing happens. The code I tried in the viewDidLoad : [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navbar-iphone.png"] forBarMetrics:UIBarMetricsDefault]; The only way I can get it to work is to set the appearance on the instance of the UINavigationBar . Like: [self.navigationController.navigationBar setBackgroundImage:[UIImage

Storyboard UINavigation Controller Back Button Text

梦想的初衷 提交于 2019-12-19 04:02:12
问题 In XCode 4.5.1 creating a storyboard app with a Navigation controller, I am having a hard time trying to set the BACK button for any view controllers that are pushed. I'm using segue's and the view controller shows as expected. However I want to change the name of the navigation bar and back button dynamically and placed this in my ViewWillAppear: self.title = @"Select Songs"; [self.backButton setTitle:@"Add"]; changes the title of the navigation bar but the back button still displays the

Back button not appearing on UINavigationController

六眼飞鱼酱① 提交于 2019-12-19 03:24:25
问题 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:@

iOS 11 Navigation TitleView misplaced

左心房为你撑大大i 提交于 2019-12-19 02:30:42
问题 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

Setting navigationController.hidesBarsOnSwipe = YES never shows my navbar again

◇◆丶佛笑我妖孽 提交于 2019-12-18 19:18:12
问题 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

Can't change UINavigationBar prompt color

家住魔仙堡 提交于 2019-12-18 18:58:06
问题 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? 回答1: 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

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

大兔子大兔子 提交于 2019-12-18 18:54:13
问题 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

Issue with button on the left side of the uinavigation bar

社会主义新天地 提交于 2019-12-18 17:30:39
问题 I have a button on the left side of the navigation bar. I also have a UIButton near that button. Now when I click the button thats below the navigation bar, in many cases, the button on the nab bar gets clicked. Any idea why this is happening? Any suggestions ? Thanks. image: if you click anywhere inside the red button, the top left button of the nav bar still gets pressed. code for nav bar button: UIButton *leftButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 25, 25)]; [leftButton