How can I add a background color to the title label of a IKImageBrowserCell? - objective-c

How can I add a background color to the title label of a IKImageBrowserCell ?
The text is not anymore visible because of the background, I would like to change the background of the label only.
thanks

It Looks like, it is inherited from NSObject. may not possible to set background color. Because UIBackgroundcolor is property of UIView. It is having a view called IKImageBrowserView should be useful.

Related

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?

NSRulerView Color

I am using NSRulerView in my app and my interface is not like default NSRulerView Color.
NSRulerView *_verticalRuler;
NSRulerView *_horizontalRuler;
This is interface declarations and I am using _verticalRuler and _horizontalRuler in my code to where to show.
Now I need a subclass of NSRulerView with another my own background color and text color. Does anybody know how to write a subclass of NSRulerView to change it's background and text color?
Thanks for your help.
Mediajon
I don't see much in the way of customisation; this does not look easy! But could try this. Subclass NSRulerView and override -drawHashMarksAndLabelsInRect: you will have to do all the custom drawing for the marks and labels. To get some inspiration for what exactly you will have to do to implement the custom drawing take a look at the gnustep project's NSRulerView. As part of the drawing you can create attributed strings, try changing the the font colour and background there.

Highlighting or filling in empty white spaces of a UIViewController

I have a UIViewController that initially is of a white background and allows the user to color in the UIImageView of a certain color by touch events. When all is done, I would like a way to highlight or show the uncolored areas (the remaining white areas) of the UIImageView. Is there a nice way to implement this. I have tried messing with CGBitMap methods but I have not been successful without any errors in code.
Thanks!
Could you simply change the background color of your UIViewController?

Background color of NSSearchfield not working

I have a NSSearchField and I want to change its background color but i am not able to do it i tried out few things:
1) I tried to set DrawBackground TRUE and then setBackgroundColor but the value of DrawBackGround is always False either I try to set it trough code or Nib.(i don't know why?)
2)I tried out setting NSText's BackgroundColor but it is not looking good because it is not covering whole NSSearchField the extreme corners where the small search icon and cancel icon is present are left uncolored.
3)I want the searchField to have the color of the view it is lying so i decreased the alpha value of the searchField which looks good but the alpha value of text is also decreased so is there any way to make text's alpha value to remain always 1.
Thanks :)
If you look at the documentation, Apple prevents background color rendering for rounded-rectangle fields:
"In order to prevent inconsistent rendering, background color rendering is disabled for rounded-bezel text fields."
https://developer.apple.com/library/prerelease/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextField_Class/#//apple_ref/occ/instm/NSTextField/setDrawsBackground:
NSSearchField is extension of NSTextField, NSTextField again extension of NSView,
Not sure, but its possible to make a custom clas and overwrite drawRect function and paint with the background color.

UILabel background color with word wrap

I would like to set a background "overlay" for my UILabel, and have it to only color the part of the label with text, instead of the entire rectangle. See the image below.
What is the best way for this to be done?