get navigation bar color to give it to status bar color on iOS 5 - objective-c

i'm new here and i actually started learning recently and i'm making my first Theos tweak (i made some with flex) and as i said in the title i'm looking for a way to get nav bar color or a color from part of the screen and apply it as the status bar background color

You're going to need to write a function to detect your targetPixelColor as a UIColor, and then apply that color to the status bar within viewWillAppear using something like
-(void)viewWillAppear:(BOOL)animated{
[self.navigationController.navigationBar setBarTintColor:targetPixelColor];
}

you should add just blow code in view didLoad.
[Example is here]I added light Gary color.you could add your own choice colour.
self.navigationController?.navigationBar.barTintColor = UIColor.lightGray

Related

UIProgressView: modify height for track line

Currently I'm able to customize my progress bar modifying the whole height, in this way:
let transformScale = CGAffineTransformMakeScale(1.0, newProgressbarHeight)
self.progressBar.transform = transformScale
There is a way to modify the height of track in order to obtain a progress bar like this?
As a workaround I was pondering of put a gray view under the progress bar track tint color to clear color.
Any ideas?
iOS 5 or later, UIProgressView could set its FrontProgress Image(Green Fat)
And its Background Image(Gray Slim).
You could set Two different picture to simulate this effect.
Front Image property: progressImage.
Background Image property: trackImage.
Or,
If you only like Pure Color to avoid wasting any resource, I think the method below will fit your demand.
1.Create two UIProgressView.Fat and Slim, Front and Behind.
2.Set the Front One's trackTintColor [UIColor clearColor].
The code and effect in simulator
I hope these could help you. Good Luck!

Status Bar turning completely black when using clipsToBounds = YES in iOS8. How do I change this?

I'm setting my NavigationBar's translucent property to NO via the UINavigationBar appearance proxy in my AppDelegate.
Then, to get rid of the 1 pixel-height separator between UINavigationBar and my view's below it, in my ViewController, I'm setting self.navigationcontroller.navigationbar.clipsToBounds = YES;.
This is to remove the separator and achieve an effect similar to this...
There's an additional view with Dates underneath the UINavigationBar.
However, when I begin to use clipsToBounds = YES, my status bar goes completely black. I don't want this. I want it to be 'blue', just like it is in the photo for this CBS Sports app.
How can I change the color of the status bar, or why is my color from the navigation bar no longer extending up to the status bar? [Also, I'm using an embedded NavigationController, not one that I dragged out onto the view]
Do not set the clipsToBounds property to YES. The way extended bars work is the layer is drawn beyond its bounds until under the status bar.
You have two options here. One is to remove the separator using runtime trickery, which I have explained how to do in this answer.
Since your case does not involve translucent navigation bar, it will be much simpler. What you want to set is shadowImage to be empty like so:
self.navigationController.navigationBar.shadowImage = [UIImage new];
But you'll notice this does not work right away. Documentation mentions that this will not work until a background image is not set using one of the setBackgroundImage: methods. Since your bar is not translucent and has a single color, you can create a 1x1px wide image with the color, and set it as the background image.
A problem here is that when you set clipsToBounds to true, you lose the top of the status bar. What I do, therefore, is just the opposite of what you're doing - I make the navigation bar absolutely transparent:
self.navbar.backgroundColor = UIColor.clearColor()
self.navbar.translucent = true
self.navbar.setBackgroundImage(UIImage(), forBarMetrics:.Default)
self.navbar.clipsToBounds = true
Now we are just seeing right through the navigation bar to whatever is behind it. So you can have whole top area of your view controller's view be blue, and you just see it.

How to make a "within window" transparent/blurry title bar using a custom base color in Yosemite?

I've been playing around with NSVisualEffectViews in Yosemite and transparent titlebars but I was wondering if it's possible to have a custom title bar, with my own base color (not that gray), that would act like Apple's.
Here's my current NSWindow:
I achieved this look by setting the following code on my custom NSWindowController:
self.window.styleMask = self.window.styleMask | NSFullSizeContentViewWindowMask;
self.window.titleVisibility = NSWindowTitleHidden;
self.window.titlebarAppearsTransparent = YES;
That blue color is just a custom NSView that's painting its rect with that particular color. The content below it is a NSTableView.
So, the goal was to actually have my titlebar to work like, let's say, Maps but instead of having the "base" color as the gray color, my "base" color would be that blue one and when the NSTableView scrolls, that content appears below my title bar.
Any ideas on how to achieve this? Thanks
Have you tried setting a blue color with a transparency of, e.g., 0.75 in the blue view, and a NSVisualEffectViewunderneath it?

UISegmentedControl custom background image

I have UINavigationBar setup as image - some wood texture. I want to insert UISegmentedControl with 4 buttons on that bar. Buttons should have same texture with slightly changed tint.
One solution would be to change tint alpha of buttons background color, so that texture in background can get trough, but as I set alpha for tint in IB it doesn't save value, it always gets back to value 1.
I cant get UISegmentedControl to show background image, so finally gave up and decide to search for help...
Effect that is desired is one in iBooks app, with buttons in Navigation Bar.
Any link or small help would be appreciated..
This post describes the steps involved and has sample code: http://idevrecipes.com/2010/12/13/wooduinavigation/
https://github.com/xhan/PlutoLand/blob/master/PlutoLand/UI/PLSegmentView.h
a custom SegmentView that can specify two images(normal, clicked)
Do not bother with one of those custom segmented control packages if you're on iOS 5 or later.
Per Dylan's suggestion, use the Appearance functionality in iOS 5+.
See the top answer here:
Customizing Left & Right UISegmentedControl Buttons

Backgrounds for UInavigationBar and UIPickerView

I understand that when you create a navigation controller it comes with a navigation bar, you are only able to select three backgrounds for this (example: translucent black etc). I've seen applications that have other colors like green with the "translucent black" type feature. Are they simply creating their own background view's and setting it for the UINavigationBar? how do they get this "translucent" effect too? like the whole view is not a single color, but the top is like a lilttle transparent and the bottom a different color. Similar to the UIPickerView that has a nice design in the background.
How can I do this? design the graphs with a graphic design program? or simply use quartz (gradients, etc) on views to get this?
Thank you!
You can change the color by changing the tintColor property of the UINavigationBar
myBar.tintColor = [UIColor greenColor];