uinavigationbar

How to change the color of navigation bar on a specific view

你说的曾经没有我的故事 提交于 2020-01-23 10:49:25
问题 I need to change the color of my navigation bar on only some specific views. There are many discussions about modifying the color of navigation bar, like https://stackoverflow.com/a/18870519/938380, but they all change the color of navigation bar on every views under the same navigation hierarchy. I want to change the color on specific views and keep other views the same color. How do I achieve this? 回答1: if you use standart navigation bar, you can't do it. But you can use some cheat ;) For

UIBarButtonItem Highlighted Color

独自空忆成欢 提交于 2020-01-23 06:22:07
问题 I have set a custom tint color for a UINavigationBar (within a UINavigationController ) which, in turn, sets an appropriate matching color for the UIBarButtonItems which are inserted into the UINavigationBar . However, when I select a UIBarButtonItem the button turns into (presumably) the highlighted state and presents a different color, which looks quite a bit out and does not nicely match the tint color. Is there a way to change this highlighted state color to a custom color? Ideally, I

How do i set the height of the UINavigationBar in an iphone app

非 Y 不嫁゛ 提交于 2020-01-22 02:38:05
问题 Im using a typical situation with UINavigationController, id like to make the navigation bar a bit taller. setting its bounds and frame dont seem to make a difference, im using this code //set up the navigation UINavigationController *navigationController = [UINavigationController new]; [navigationController.navigationBar setBarStyle:UIBarStyleBlack]; [navigationController.navigationBar setTintColor:[UIColor purpleColor]]; [navigationController.navigationBar setBounds:CGRectMake(0.0, 0.0, 480

Change UIBarbuttonItems Color

放肆的年华 提交于 2020-01-21 06:28:09
问题 How can I set UIBarButtonItem's color to green? I'm using iOS 4 , there is no tint property. please help me. 回答1: In iOS 4: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setBackgroundImage:[UIImage imageNamed:@"green.png"] forState:UIControlStateNormal]; button.frame=CGRectMake(0.0, 100.0, 60.0, 30.0); [button setTitle:@"Green" forState:UIControlStateNormal]; [button addTarget:self action:@selector(yourAction) forControlEvents:UIControlEventTouchUpInside];

Multiple Modally Presented (page sheet) ViewControllers Navigation Item Bug

不羁岁月 提交于 2020-01-17 14:04:06
问题 iOS 13. The problem is shown on the screenshot. The steps are: Open one view controller modally with page sheet style. Open another (second) view controller modally with page sheet style. Expected: no Nav Bar bug Actual: see screenshot The source code is available here: https://github.com/rinat-enikeev/NavBarBug Question: how to fix this bug? I want to present 2 view controllers modally with page sheet style. 回答1: Ok, for those who faced the same issue. The workaround is to add the following

move navigationBar's left and right barButtonItem's vertically upwards

放肆的年华 提交于 2020-01-17 07:25:52
问题 I am trying to move my navigation bar's left and right barButtonItem's upwards vertically without any success. I can manage to move the title view up but using the same method for the barButtonItem's doesn't do anything. The effect I'm trying to achieve is what is used on the Bookmarks page of safari: I'm hoping to achieve this without any subclassing of the navigationBar so that I can maintain the translucency. My approach was to add UIView's to the navigationBar directly in IB for the

Remove the dark Line at the bottom of Navigationbar/Searchbar

强颜欢笑 提交于 2020-01-16 18:33:10
问题 I want to make a clean white Design. So, I set the tintColor property to whiteColor , but there are these dark Lines under the UINavigationBar and UISearchBar . Do some one know, how to remove the dark Lines or how to change the Color? 回答1: This is what I did, and seemed to work, it is a further development of this link. I changed the explicit width declaration to a dynamic one, so that it will be the size of the view if you change view size or not: UIView *overlayView = [[UIView alloc]

Remove the dark Line at the bottom of Navigationbar/Searchbar

这一生的挚爱 提交于 2020-01-16 18:33:09
问题 I want to make a clean white Design. So, I set the tintColor property to whiteColor , but there are these dark Lines under the UINavigationBar and UISearchBar . Do some one know, how to remove the dark Lines or how to change the Color? 回答1: This is what I did, and seemed to work, it is a further development of this link. I changed the explicit width declaration to a dynamic one, so that it will be the size of the view if you change view size or not: UIView *overlayView = [[UIView alloc]

Navigation Bar Changes Height

安稳与你 提交于 2020-01-14 03:23:38
问题 When I push my UIViewController to the screen from my previous controller it animates the change. But when it finishes loading it resizes my navigation bar and the jumpy transition makes it look bad. How can I fix this? All I'm doing is hiding the navigation bar in Controller A in viewWillAppear and showing it in Controller B in viewDidLoad . 回答1: Ok solved it. In viewDidLoad of Controller B (the view controller I'm pushing) add the following: UINavigationBar *navigationBar = self

Android ActionBar pattern - multiple activities or fragments

最后都变了- 提交于 2020-01-13 06:04:39
问题 There are few similar questions on stackoverlow, but I haven't find clear explanation at any of the answers how to implement Action Bar pattern for more complex/multiple activities apps. As I understand, there are two options to do this: 1.) implement multiple activities and in each of them implement/include action bar --> problem with this is that when ever you lunch new activity, although it has the same looking action bar, it has that transition, and jumps through the screen, so it's