I am trying to customize an IKImageBrowserCell to have something close to the Finder.
For the moment my issue is to have a title in 2 lines. Do you have any experience of what need to be modified in order to achieve this?
Thanks and regards,
Yes, this is possible by drawing your title on a CALayer returned from the - (CALayer *)layerForType:(NSString *)type method of a subclassed IKImageBrowserCell.
See my answer here.
Related
I am trying to change the dots in a ParentViewController in function of which ChildViewController appears but I didn't find how to do it. (in swift)
Any idea ?
Here is a gif to give you a better idea :) http://gfycat.com/WarmUglyAppaloosa
I finally found the solution in this post which has a different goal but work in my case too ! https://stackoverflow.com/a/21048603/5164509
Is there any feature equivalent to "GridBagLayout as in swing" in cocoa?
Spent some time in searching with no luck.
Any help or suggestions to create something like GridBagLayout in cocoa is appreciated:)
Thanks:)
There isn't. Closest thing to GridBagLayout in Java is probably the NSCollectionView displaying an array of content as a grid of views:
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSCollectionView_Class/Introduction/Introduction.html
https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSCollectionView_Class/Introduction/Introduction.html#//apple_ref/occ/cl/NSCollectionView
As you can see in the screenshot below, the NSCollectionView I used has some kind of border (the thin gray lines) I want to get rid of. Can somebody tell me how to achieve this? I already tried subclassing the NSCollectionView and tried to overwrite it in the drawRect: by using [[super layer] setBorderWidth:0.0f]; but this did not work.
Searching on Google, SO and the Apple Documentation did not help either. So did anyone achieved this already or knows where I can find an example of how to do it?
Thanks in advance,
Björn
The collectionView is nested in a NSScrollView, which has a borderType property.
You can get rid of the border by simply setting its border type to NSNoBorder.
self.collectionView.enclosingScrollView.borderType = NSNoBorder;
From story board:
Select the scroll view from story board
Then choose no boarder from Attributes Inspector
For Swift 3 :-
collectionView.enclosingScrollView?.borderType = .noBorder
The question title is kind of vague, but I really don't know what the thing is called.
I am trying to create one of those yellow informational popup things. Anyone can tell me what they're called and how I can create them?
That's called a tool tip. You can set the tool tip for any NSView using setToolTip:.
If you are using NSTextView, you can even set an attribute for a certain range in NSTextstorage, that displays the Tooltip.
Something like:
[textStorage addAttribute:NSToolTipAttributeName
value:error.description
range:range];
How guys.
I'm not top dev in java, but what I`m really not is cocoa top dev :P
I would like to have your assistance to produce a layout with cocoa and IB to work just like the CardLayout in Java.
Do you have some idea of how to do it?
Thanks for the attention!
EDIT:
CardLayout: A set of panels ("cards") are designed to compose a "deck of cards".It works like a queue of panels, in which only the first "card" is shown on the interface.I can easily interchange between cards if I want so to modify the interface to the user.
I hope I could help you to help me. =)
A tabless NSTabView can be used for something like this.