How to change UIWebview bottom toolbar color? - ios

I have created a UIWebview in my app. I managed to change the background color of the navigation bar with setTintColor. However, I am unable to do the same for the bottom bar (with back/forward/refresh buttons). Can anyone help?

Did you create the bottom bar yourself? It probably is an UIToolbar:
UIToolbar *bottomToolbar = [[UIToolbar alloc] init];
bottomToolbar.tintColor = [UIColor redColor];

Related

iOS double navigation bar by set translucent OFF

at First:
I work with the storyboard interface builder...
I tried to color my navigation bar like Instagram:
UIColor *mainColorBlue = [UIColor colorWithRed:0.071 green:0.337 blue:0.533 alpha:1];
[[UINavigationBar appearance] setBarTintColor:mainColorBlue];
[[UINavigationBar appearance] setBackgroundColor:mainColorBlue];
But if i set the color to mainColorBlue, it is not this color. I've read in the internet, that it is cause from translucent. So I set translucent to OFF.
But now, my Problem is: If i deactivate the translucent and activate opaque and start the app on my external device, under the navigation bar is another navigation bar. If i switch the translucent to ON again,the second navigation bar isn't shown.
What i have to do, that the second navigation bar disappear?
I resolve the problem.
I added a subview on position 0,0 to color the statusbar.
UIView *statusBarColor = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 64)];
statusBarColor.backgroundColor = mainColorBlue;
[self.view addSubview:statusBarColor];
So this View is displayed under the navigation bar. I removed this code and now it works.

Getting Navigation Bar Color For View is Not Working

I have getting navigation bar color and set it to view as background color but it's not as same as the color in bar.
I don't know why it's doing so.
Your solutions are welcome and i hope you help me in that matter.
CODE
self.navigationController.navigationBar.tintColor = [UIColor blueColor]
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0,0,20,20)];
view.backgroundColor= self.navigationController.navigationBar.tintColor;
In my application design we have same theme that's why it's not getting the theme of navigation view background color
there is some difference.
Use -[UINavigationBar barTintColor] property instead of tintColor
PS. Be aware of translucency :)

How to deal with default paddings while customise navigation bar with title view?

I am trying to customise the navigation bar with title view.
But it seems setting title view comes with its own left and right and top paddings.I was expecting the title view to cover the whole navigation bar according to the frames given.
Is it expected behaviour and if YES than how to deal with that?
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 375, 44)];
view.backgroundColor = [UIColor greenColor];
//Navigation Bar
self.navigationItem.titleView = view;
If you just want the navigation bar to be green use [self.navigationController.navigationBar setBarTintColor:[UIColor greenColor]]; in iOS 7+ or [self.navigationController.navigationBar setTintColor:[UIColor greenColor]]; in iOS 6-
Yes, it seems it is not possible to remove that left/right padding. This is the screenshot form debugging views in Xcode after running your code
The outside view that is gray is the navigationBar and the green is obviously the titleView. No matter the frame for the titleView, it is clipped.
Apple documentation says just this:
Custom title views are centered on the navigation bar and may be resized to fit.
I think the only solution would be to subclass the navigationBar, so that you override the titleView frame.

UITextField with inputView showing UIPickerView... how to turn off translucency in IOS 7?

We have a tab bar. In one of the controllers, we have a UITextField. Clicking on that brings up a picker, using the inputView field of the UITextField. My team likes the look of that on iOS 6, but on iOS 7 they see the blurred background and tab bar coming through. Can I turn off that translucency, and where do I need to do that?
self.termsPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 43, 320, 480)];
self.termsPickerView.delegate = self;
self.termsPickerView.dataSource = self;
[self.termsPickerView setShowsSelectionIndicator:YES];
self.termTextField.inputView = self.termsPickerView ;
self.termTextField.delegate = self;
UIPickerView in iOS 7.0 is translucent by default and that is the nature, and like all other views, is simple a background color controlling the color.
So to fix your problem you could do,
self.pickerView.backgroundColor = [UIColor whiteColor];
The apple documentation doesn't show any means of turning this transparency off.
tabBarController.tabBar.translucent = NO;

Custom UINavigationBar for MFMailComposeViewController

I have a UINavigationBar with an image for its tint to customize its appearance. However when I present the mail composer as a modal view the default UINavigationBar is displayed. Any suggestions how I can change that so that my custom bar is displayed?
You can access the navigation bar directly like so:
MFMailComposeViewController *viewController = [[MFMailComposeViewController alloc] init];
viewController.navigationBar.tintColor = [UIColor blueColor]; ///< Or whatever colour you want to tint it / set the background image to, etc.

Resources