I'm using UISearchBar as header of UITableView. UISearchBar style is UISearchBarStyleMinimal. And when search is active, status bar change to black. How to fix that?
Before search is active
Search is active
you just need to do this:
self.navigationController.view.backgroundColor = [UIColor lightGrayColor];
Related
This is driving me crazy, I can not figure out what that black line is behind my search bar.
My view hierarchy is a UINavigationController -> UITableViewController with a SearchDisplayController, and I customize the appearance of the search bar with the following code:
[[UISearchBar appearance] setImage:[ApplicationStyle searchBarIconImage] forSearchBarIcon:UISearchBarIconSearch state:UIControlStateNormal];
[[UISearchBar appearance] setBackgroundImage:[ApplicationStyle searchBarImage]];
[[UISearchBar appearance] setSearchFieldBackgroundImage:[ApplicationStyle searchBarFieldImage] forState:UIControlStateNormal];
The image I am using for the background is 640px x 88px and it is not transparent by any means. Any ideas what this could be?
Set the search bar's clipsToBounds property to YES.
Relevant SO questions:
Is it possible to change the border color of a UISearchDisplayController's search bar?
Get rid of line above UITableView
While using uisearchbar with scope bar the tint color of scope bar is not updating in iOS 4.3.In remaining iOS versions it is working perfectly.I have shown the screenshot of that sample here.Any ideas to solve this please.
for (id subview in yourSearchDisplayController.searchBar.subviews )
{
if([subview isMemberOfClass:[UISegmentedControl class]])
{
UISegmentedControl *scopeBar=(UISegmentedControl *) subview;
[scopeBar setSegmentedControlStyle:UISegmentedControlStyleBar];
[scopeBar setTintColor: [UIColor redColor]];//you can also set RGB color here
//scopeBar.tintColor = [UIColor blackColor];
}
}
Also see my answer from this link for modify the UISearchBar component
How to change inside background color of UISearchBar component on iOS
If I remember correctly, it was not possible to change a tint of the scope bar. One solution could be to search all the subviews of the search bar and find the scope bar object and try to modify its background. But this might lead you to modifying private property so it might not be acceptable. I was trying going this way but I abandoned it, not sure why.
Other not so clean solution would be to implement the scope bar by yourself and add it as a subview to the search bar and block the original scope bar. Do this only for the iOS 4.3 or less.
Change the tint color for changing color of scope bar. Note BarTintColor is different - this will change the color of the search bar.
I wanted to change the color of the navigation bar and tool bar, but the color of the page curl system icon UIBarButtonSystemItemPageCurl does not change with the tool bar tint color. If I use other system icons like bookmark, they will change. Does anyone have a solution for this sort of problem?
I used the following lines to change the color of the navigation bar and the tool bar.
self.navigationController.navigationBar.tintColor = [UIColor redColor];
self.navigationController.toolbar.tintColor = [UIColor redColor];
Here is a screenshot showing that the Page Curl color does not change:
Try setting the tintColor for UIBarButtonSystemItemPageCurl before adding it to the toolbar? This was certainly an issue when I last looked in iOS 4.3.
I am trying to customize the moreNavigationController in a UITabBarController. I have been reading a lot of posts and guides to style this and I have managed to change the tint color of the navigation bar and the background color of the table view but there are still a few things that I would like to customize.
I have changed the tint color and the background like this:
tabcontroller.moreNavigationController.navigationBar.tintColor = [UIColor orangeColor];
tabcontroller.moreNavigationController.topViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"tableview-background-blue.png"]];
tabcontroller.moreNavigationController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:#"tableview-background-blue.png"]];
I would like to change the seperate color (the border) of the UITableView. I would also like to change the tint color of the navigation bar which appears when clicking "Edit". Also it would be great if I could change the language of the whole thing (the "More" and the "Edit" tab and so on)
Would these changes be possible and if so, do you know how?
I think you can't change the names of this tabs, which are predefined. I'm taking about the Edit button & the more tab.
I have a UISegmentedControl on a black UIToolbar. I have set the style to Bar and set the background color to clear (also tried black). I have tried setting the tintColor clear (also tried black). My buttons turn black to match the black UIToolbar. However, the buttons no longer indicate a clicked state like they do when the UISegmentedControl is the default blue/grey. What do I have to do to make the buttons indicate a black/grey clicked state? Please let me know. Code used so far to set the color of the UISegmentedControl:
viewTypeSelection.segmentedControlStyle = UISegmentedControlStyleBar;
viewTypeSelection.backgroundColor = [UIColor clearColor];
While not a perfect solution, this works pretty well
// set the color
viewTypeSelection.segmentedControlStyle = UISegmentedControlStyleBar;
viewTypeSelection.tintColor = [UIColor darkGrayColor];
The buttons have state change and it looks OK. Here is a post that has a few more details and might help someone looking for a similar solution:
UISegmentedControl black?
You may have set the color of the bar with tintColor instead of setting barStyle like so:
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;