How to "tint" UIVisualEffectView on iOS 8+? Or, create a blurred background view with a tint color? - uikit

Self-explanatory. UIVisualEffectView only has a light, dark, and "extra light" tint variation. Is there a way to tint with a color instead, such as the tint color of the app?
UINavigationBar sort of does this, I think, in that it has transparency and blur... but also a tint color.
Third-party libraries are OK, but I'm not sure where to look for this.

You can tint the UIVisualEffectView using this library:
https://github.com/efremidze/VisualEffectView

Set a UIView with an alpha of 0.5 or so with a background color. In front of that put a UIVisualEffectView. Remember to not set the visual effect view as a subview of the first background view.
That should do the trick.

It seems like FXBlurView is the way to go currently for tinted blurs. https://github.com/nicklockwood/FXBlurView

You could maybe put it in a UIView that had a semi-opaque background color of the opacity to your liking...

Related

Is it even possible to make NSPopver fully transparent?

I tried my hands on changing the color of NSPopover, I am able to change to it all desired color except transparent.
As, it is known that NSPopover is by default semi transparent. I tried changing the NSWindow color directly, by Layer as well, I also tried setting the NSView's color to transparent i.e. NSColor.Clear but no luck.
So the question is - Is this possible to change the background color of NSPopover to transparent?
No this is (sadly) not possible.

UIImageView Tint Color weirdness

I'm using pdf images in Xcode 10.
The settings are as follows:
As you can see the image has been set to be rendered as Template Image
Now when setting the image in an imageView and setting the tint color, this weird thing happens:
If the tint color is not white or any white hue, it is rendered correctly on the phone
If the tint color is set to white or any hue that is white (light gray, etc), then it's rendered fine in the Interface Builder, but it appears black on the phone
I even tried setting the tint color at runtime, but same thing happens.
Any clues why this is happening?
I'm starting to think this is a bug in Xcode, but wondering if I missed something!
Ok, this seems to be indeed a bug.
Found this:
http://openradar.appspot.com/23759908
And yes, calling tintColorDidChange in viewWillAppear does solve the problem.

iOS 7 BarTintColor

Have any one else noticed in iOS7, the translucent navigation bar only shows color underneath if barTintColor is set to default?
I tried setting barTintColor to various different colors, but anything that is below the navigation bar is displayed a a black blur. Whereas if the barTintColor is set to default, all the elements display correctly underneath.
Is there a way to force it to show the correct colors?
You have to use background color instead of tint color.
self.navigationController.navigationBar.backgroundColor = [UIColor yellowColor];
If you are using tint color it changes only barbutton background color change.
In MyTabBarController in the storyboard select the color tint. You will change the button active color background. No idea for the inactive one.

how to set background color to IKImageBrowserView

I am new to cocoa..
I am creating one of the colorful window. so I need set background color to IKImageBrowserView. I think subclassing IKImageBrowserView is the way to set background color but it is too difficult for me..
Any other way to set background color without subclassing?
You can achieve what You want by using setValue:forKey with option key IKImageBrowserBackgroundColorKey like this:
[imageBrowserViewOutlet setValue:[NSColor redColor] forKey:IKImageBrowserBackgroundColorKey];
Note: imageBrowserViewOutlet is IKImageBrowserView outlet.
You can do that by using:
[thumbnailBrowser setValue:[NSColor colorWithDeviceRed:0.125f green:0.145f blue:0.145f alpha:1.0f] forKey:IKImageBrowserBackgroundColorKey];
Change RGB as you like. thumbnailBrowser is IKImageBrowserView. Gook luck!

Button with gradient like tint color for segmented control

I should to reproduce this behavior
I've tried using NSGradient with a simple linear gradient in order to fill it but it's a poor result. What kind of gradient is it?
Are you putting the button in a UINavigationBar or a toolbar?
UIBarButtonItem will do that shading on its own, but it tends to live in a toolbar or navbar.

Resources