UIToolbar being transparent instead of translucent. - ios

I'm simply adding a UIToolbar above a UITableView.
By default, the appearance of the toolbar should be a whitish translucent color however (like the navigation bar right?).
I am getting an almost fully transparent color (I can totally see through the toolbar into the UITableViewCell contents very clearly).
Does anybody else have this problem?
Here's a screenshot.

I suggest you to check these following helping links upon the Bar color for iOS 7 (UIToolbar and UINavigationBar):
1) http://b2cloud.com.au/how-to-guides/bar-color-calculator-for-ios7/
2) http://www.objc.io/issue-5/iOS7-hidden-gems-and-workarounds.html
And also I suggest you to read the Apple Documentation for UIToolbar Class Reference.

Related

Set navigation bottom bar color programatically

Is there away i can set the colour of may navigationController bottom bar colour. Similar to setting top bar in the app delegate with
[[UINavigationBar appearance]setBackgroundColor:color];
can bottomBarColor or something be used?
thanks
The problem is you mistakenly believe that the bar you see at the bottom is a real bar instance/object.
It is not, it is just a simulation of a future situation.
With bar metrics feature in Interface Builder, you can simulate a situation when you view controller will be a part of larger view hierarchy which will contain a bar at a bottom. You can simulate this in design time, and this way you can adjust your AutoLayout constraints, or frames, as if the bar was there so this way the constraints/ frames will behave correctly when it really happens.
If you want a bar with orange colour, you need to have a real bar instance added to some view controller, and change its appearance. But I repeat, it needs to be a real bar instance, not a bar metrics simulation.
Btw, it is AFAIK not possible to put a navigation bar to the bottom, for that you need to use UIToolbar class.
If you want to set the toolbar color globally do this in your AppDelegates didFinishLanchingWithOptions method:
[[UIToolbar appearance] setBarTintColor:[UIColor blackColor]];
Of course your selected color doesn't have to be black.

UIToolbar incorrect colour in iOS7

When I set the bottom UIToolbar to black on the view controller, it appears as a more greyish colour (the same thing happens with other colours--it sort of fades them out). What I assume is happening is that in iOS7 the toolbar seems to adapt the colour of what is beneath it (currently white) which makes for the duller colour.
I've updated the view controller so that the "extended edges" options are turned off but still get this effect. Has anyone else had this issue yet?
UPDATE:
I resolved the issue by setting the background colour of the UIToolbar to black (something I haven't had to do in previous versions of iOS). If anyone can think of a better solution, let me know.
All tool- and navigation bars in iOS 7 have a translucent property.
This causes the effect, where the background shines through in blurred form (just like the control center).
Just set YourToolbar.translucent = NO;.
SET the t*ranslucent property to NO*:-
IN iOS 7 you need to set the barTintColor Property-
UIToolbar *doneToolbar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 584, 320, 44)];
doneToolbar.translucent=NO;
doneToolbar.barTintColor=[UIColor blackColor];
[self.view addSubview:doneToolbar];
I have used it its working fine...
setting the background color instead of the bar tint worked for me
I set the bar tint to default, the translucent property to NO and the background to the color i wanted and it worked for me.

UITabBar not updating appearance after Load

I am having a problem with UITabBar, seems like the call to
[[UITabBar appearance] setSelectedImageTintColor:barColor];
does nothing once the tabbar is showing, if i put the line in the ViewDidLoad (ViewWillAppear) it does work.
Any hint?
in the Apple docs for UITabBar it says
"The tint color to apply to the gradient image used when creating the selected image."
Note the creating, meaning that it reads this property when initalising/creating the tab bar, but it can't be set after. If you wanted to dynamically you'd have to get a little bit fiddly and overlay a semi transparent UIView over the selected image to change the colour, but it's not really ideal... There is some examples of that type of thing here
Changing Tint / Background color of UITabBar

Change statusbar tint colour

Is there a way to set the status bar tint colour?
I have my navigationbar tint set to brown and when it's on screen it also changes the statusbar to brown, however on views that I hide the navigationbar the statusbar returns to its original colour.
How can I change the statusbar tint colour to persist trough the application?
There is no way in iOS 5. You can just change your bar style.
But if you take a look at new WWDC 2012 Sessions, you may find something interesting)
Session number 216 - Advanced Appearance Customization on iOS
Maybe keep the notification bar there but cover it up? If the notification bar's color influences that of the status bar, then it would lead me to believe that it just has to be in the window (even buried under another view) to change it.
There is no way in iOS 5 or ealier version of ios.
now ios 6 have feature to change status bar tint color or it will set according to navigation bar pattern Image
But u can use Custom Status Bar
What I do in screens that have no navigation bar is to put in a navigation bar at the top but behind the visible interface. The navigation bar is not visible to the user, but it is visible to the system and causes the status bar to adopt its color.
EDIT: Sorry, I see now that someone else had already suggested this. So I'm just confirming that it does work.

Customizing the UIPopoverController view background and border color

Is it possible to change the border color, navigation bar style/color, and arrow style/color of a pop over view? If so, how? If some sample code is available, then that'll be great!
iOS 7 onwards, you can change backgroundColor of UIPopoverController which affects the navigation background color as well as arrows of popover.
#property (nonatomic, copy) UIColor *backgroundColor NS_AVAILABLE_IOS(7_0);
Usage example:
if ([self.popoverVC respondsToSelector:#selector(setBackgroundColor:)]) { // Check to avoid app crash prior to iOS 7
self.popoverVC.backgroundColor = [UIColor greenColor];
}
Note - As of now (iOS 7.0.3), in some cases (like set color using colorWithPatternImage:), the simulator doesn't honor the color but on device it works fine.
Now in iOS 5, popoverBackgroundViewClass is available.
Unfortunately, UIPopoverController is not customizable like that. You can't change the border color, navigation bar style/color, or arrow style/color: How to customize / style a UIPopoverController.
From ios 5 onward you can do much just try this library https://github.com/ddebin/DDPopoverBackgroundView
you can customise border tint color, bodrer width as well as arrow
look at the documentation
The navigation bar and tool bar inside a popover are just a standard UINavigationBar and UIToolBar, I've had success in changing their appearance just as you would with a normal nav bar or tool bar. The border however is not easily customizable.
You can use ElegantPopover cocoapod to accomplish some of that.
I try to trick it by customizing the viewcontroller inside the popover and then hiding the popover border using this code
UIView * border = [[insideViewController.view.superview.superview.superview subviews] objectAtIndex:0];
border.hidden = YES;
The app is actually still in development so I'm hoping other people will comment on this solution.

Resources