uinavigationbar

UINavigationBar turns white and won't close when using navigationItem.searchController in iOS 13

自闭症网瘾萝莉.ら 提交于 2020-01-06 08:12:35
问题 I am having trouble using navigationItem.searchController in iOS 13. The search bar of the search controller is initially closed, but it won't collapse back after I scroll the table view. It 'bounces' back when I try to hide the bar. Also, the navigation bar turns white after the search bar appears. (The navigation bar has a custom tint color; see the attached screenshots.) Note that this wasn't the case in iOS < 13. Is this a bug in iOS 13? If it is, is there a work around to keep the tint

Best point to overwrite the navigationBar property of navigationController

*爱你&永不变心* 提交于 2020-01-06 04:54:29
问题 I'm overwriting UINavigationController to replace the default navigationBar property with an instance of my own subclass of UINavigationBar . So I tried something like _navigationBar = [[SBNavigationBar alloc] init]; in my -initWithRootViewController: . But that didn't work out as I expected it. There's still the default navigationBar being displayed. So what's the best point to overwrite the navigationBar ? Thanks in advance –f 回答1: If you check the documentation http://developer.apple.com

How to remove the back arrow ios 7 navigation bar?

自作多情 提交于 2020-01-05 14:02:32
问题 In my custom navigation bar, i want to use hide default back button and use my customize left button, but even if the back button is hidden, it sill take some space at the left end of navigation bar. How to get rid of back arrow button completely? I have tried to set backBarButtonItem and 'hidesBackButton properties of UINavigationItem`, but none of these works. UPDATED: - (void) viewDidLoad{ //... self.navigationItem.hidesBackButton = YES; self.navigationItem.leftBarButtonItem = [

Custom back button for NavigationController for every screen

痞子三分冷 提交于 2020-01-05 09:08:53
问题 I have been trying to subclass the UINavigationController class for modifying things like background image, navigation bar size, back button, tittle font and so on. After a couple of hours and a lot of reading I have understand that I should not subclass the UINavigationController class... I would like to have specific design and transfer that design to all screens that use my custom NavigationController... SO far I haven't fount any elegant solution for this, most of the solutions are based

How can I make a UINavigationController's UINavigationBar invisible or at least change color

一个人想着一个人 提交于 2020-01-04 09:08:09
问题 I have a UINavigationController that is Linked to a ViewController that is set as RootController. I have enabled the UINavigationBar and put 3 UIViews each with a UIButton inside. Ideally I would like to make the UINavigationBar completely invisible, but I would also settle for setting the color to the background color of my ViewController. I am working in swift and I have tried things like self.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default) self

Custom uinavigatonbar exception

只愿长相守 提交于 2020-01-04 06:20:27
问题 I've made a custom uinavigation bar this way: @implementation UINavigationBar (UINavigationBarCategory) - (void)drawRect:(CGRect)rect { UIImage *img = [UIImage imageNamed: @"navigation_background.png"]; [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end Now I'd like to add exception to show the normal uinavigation bar when i load an specific viewcontroller into de navigationcontroller. How can I code that exception? 回答1: I don't think that's possible with

Custom uinavigatonbar exception

旧街凉风 提交于 2020-01-04 06:20:25
问题 I've made a custom uinavigation bar this way: @implementation UINavigationBar (UINavigationBarCategory) - (void)drawRect:(CGRect)rect { UIImage *img = [UIImage imageNamed: @"navigation_background.png"]; [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; } @end Now I'd like to add exception to show the normal uinavigation bar when i load an specific viewcontroller into de navigationcontroller. How can I code that exception? 回答1: I don't think that's possible with

How to set action to the backButtonItem on the navigation bar?

橙三吉。 提交于 2020-01-04 05:18:07
问题 How to set action to the backButtonItem on the navigation bar? I have a navigation bar, when I'm pressing the back button, I need to alert some message to the user, and only after user's reaction - return to the previous view. How can I do it? Thanx! - (void)viewDidLoad { [super viewDidLoad]; //no one field don't changed yet isDirty = FALSE; //edited user //set default values newData = [data copy]; //setting navigation controller rigth button UIBarButtonItem *rightButton = [[UIBarButtonItem

How to make searchbar corner round

让人想犯罪 __ 提交于 2020-01-04 04:36:51
问题 I am trying to make searchBar corner rounded. I have tried many ways of using layer.cornerRadius , maskToBound = true . I am loading the searchBar in the navigationBar programmatically. I have tried many solution given on stack-overflow but nothing worked. func setupsearchbar() { // Setup the Search Controller searchcontroller.searchResultsUpdater = self as? UISearchResultsUpdating searchcontroller.hidesNavigationBarDuringPresentation = false searchcontroller.searchBar.placeholder = "Search"

Create UIBarButtonItem with back button style

别来无恙 提交于 2020-01-04 04:00:32
问题 I'm looking for a way to create programmatically an UIBarButtonItem that looks like a back button of UINavigationBar . Apparently seems like that the back button appears only after a push on the UINavigationController . So I'm able to insert only a button with the "cancel" style. But my goal is to create a button with the "New Item" style. Ideas ? 回答1: the short answer is you cannot do it. you can save an image and you can put the image to that position, but the back button is managed by