uinavigationbar

Changing navigation bar color in Swift

ぃ、小莉子 提交于 2019-11-26 06:54:44
问题 I am using a Picker View to allow the user to choose the colour theme for the entire app. I am planning on changing the colour of the navigation bar, background and possibly the tab bar (if that is possible). I\'ve been researching how to do this but can\'t find any Swift examples. Could anyone please give me an example of the code I would need to use to change the navigation bar colour and navigation bar text colour? (The Picker View is set up, I\'m just looking for the code to change the UI

How to draw a transparent UIToolbar or UINavigationBar in iOS7

允我心安 提交于 2019-11-26 06:53:35
问题 I would like an entirely transparent UIToolbar and/or UINavigationBar . I have tried the various incantations suggested for pre- and post-iOS 5 but none seem to work any more. How might this be accomplished in iOS 7? 回答1: Swift 3 (iOS 10) Transparent UIToolbar self.toolbar.setBackgroundImage(UIImage(), forToolbarPosition: .any, barMetrics: .default) self.toolbar.setShadowImage(UIImage(), forToolbarPosition: .any) Transparent UINavigationBar self.navigationBar.setBackgroundImage(UIImage(), for

Removing the title text of an iOS UIBarButtonItem

最后都变了- 提交于 2019-11-26 06:04:08
问题 What I wanted to do is to remove the text from the \'Back\' button of a UIBarButtonItem , leaving only the blue chevron on the navigation bar. Keep in mind that I\'m developing for iOS 7. I\'ve tried several methods, including, but not limited to: This is the image method which I did not like (the image looked out of place): UIBarButtonItem *barBtnItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@\"iOS7BackButton\"] style:UIBarButtonItemStylePlain target:self action:@selector

IOS 7 Navigation Bar text and arrow color

谁说我不能喝 提交于 2019-11-26 05:58:56
问题 I want to set background for Navigation Bar to be black and all colors inside it to be white . So, I used this code : [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName, [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], NSForegroundColorAttributeName, [UIFont fontWithName:@\"Arial-Bold\" size:0.0], NSFontAttributeName, nil]]; But back button

How to change Navigation Bar color in iOS 7?

*爱你&永不变心* 提交于 2019-11-26 05:42:59
问题 How do I change the Navigation Bar color in iOS 7? Basically I want to achieve something like the Twitter Nav Bar (updated Twitter for iOS7 that is). I embedded-in a nav bar atop a view controller . All I want is to change the nav bar color to light blue along with the utility bar at the top. I can\'t seem to find an option in my storyboard . 回答1: The behavior of tintColor for bars has changed in iOS 7.0. It no longer affects the bar's background. From the documentation: barTintColor Class

Imitate Facebook hide/show expanding/contracting Navigation Bar

佐手、 提交于 2019-11-26 05:39:48
In the new iOS7 Facebook iPhone app, when the user scrolls up the navigationBar gradually hides itself to a point where it completely vanishes. Then when the user scrolls down the navigationBar gradually shows itself. How would you implement this behavior yourself? I am aware of the following solution but it disappears right away and it isn't tied to the speed of the user's scroll gesture at all. [navigationController setNavigationBarHidden: YES animated:YES]; I hope this isn't a duplicate as I'm not sure how best to describe the "expanding/contracting" behavior. The solution given by

How to Edit Empty Spaces of Left, Right UIBarButtonItem in UINavigationBar [iOS 7]

試著忘記壹切 提交于 2019-11-26 05:16:22
问题 I was using iOS 6.1 earlier, but now I have moved to iOS 7. Along with other problems, I have observed that in my navigation bar, the left space of left bar button item and right empty space of the right button bar item are quite more in IOS 7 than in iOS 6. I need to know is there a way I can reduce empty spaces of left, right bar button items in navigation bar?? Thanks in advance. 回答1: I was also facing this problem. I also have feelings that in iOS 7 there is more space. And I figured out

transparent navigation bar ios

微笑、不失礼 提交于 2019-11-26 04:59:54
问题 I\'m creating an app and i\'ve browsed on the internet and i\'m wondering how they make this transparent navigationBar like this: I\'ve added following like in my appdelegate: UINavigationBar.appearance().translucent = true but this just makes it look like following: How can i make the navigationBar transparent like first image 回答1: You can apply Navigation Bar Image like below for Translucent. Objective-C: [self.navigationController.navigationBar setBackgroundImage:[UIImage new]

NavigationBar delay updating barTintColor iOS10

别等时光非礼了梦想. 提交于 2019-11-26 04:54:41
问题 Context: Let\'s say we have one NavigationController and 2 viewControllers. ViewControllerA has a blue navigationBar, while ViewControllerB has a green one. I set them up like so : override func viewWillAppear(_ animated: Bool) { self.navigationController?.navigationBar.barTintColor = UIColor.blue // Green if ViewController B } It works well when I got from A to B, but when I return, the navigationBar teint is updated after. Like if it was set up in the viewDidAppear . Expected: The

UISegmentedControl below UINavigationbar in iOS 7

那年仲夏 提交于 2019-11-26 04:30:01
问题 How do I make a UISegmentedControl as a part of an UINavigationBar below it? Is it connected to the UINavigationBar or is it a complete separate view just added as a subview to the UINavigationController \'s view controller. Looks like it is part of the UINavigationBar since there is a shadow below the bar. 回答1: It's a simple effect to accomplish. First, place a segment in a toolbar. Place this toolbar right below the navigation bar. Set the delegate of the toolbar to your view controller,