I have an NSTextView with an NSTableView in a window. I'd like to be able to have those handles that allow you to drag the separator and resize the two adjacent views. I'm new to the cocoa and generally UI design on mac, so am having trouble with finding something as basic as this. I say 'basic' since I see this on pretty much every mac app I've ever used.
Like Skim.app has left and right panes for notes and contents, and both can be resized with the pdf view in the middle expanding or contracting accordingly.
Apologies for not using the right UI lingo to describe the problem.
I think you're looking for NSSplitView.
Related
When I try to place objects using the Interface Builder in Xcode into a NSScrollView, they appear fine until runtime in the application, where they do not appear at all for some reason. I want it to be so that I can place multiple buttons and labels in the view, and have the user be able to scroll down to see more.
Am I not meant to use NSScrollView for this purpose?
Is there another way to go about implementing it I am not aware of?
You need to check the where you added the UI objects.
You need to consider these :
Is your autolayout enabled?
Did you flipped the view?
Resizing mask is working good as per your requirement.
Am I not meant to use NSScrollView for this purpose?
No, you picked the correct control for the requirement. NSScrollView is indeed for same kind of use.
I would like to make a table-view with expanding ability.
When you press a row, the row should expand to show options like delete, copy and so on.
I have found an example for iOS, but I didn't get it running on Mac OS X, because NSTableView and UITableView are very different.
http://www.cocoacontrols.com/platforms/ios/controls/kofiles
Has anyone another template?
Or maybe even get this example running on Mac OS X?
I don't have code to hand you but you can use a view-based NSTableView. Your prototype view can resize itself to include controls if it's selected. All that's a bit complex to condense into a reasonably brief answer but if you use a view-based table view and treat the prototype view like any other that would grow and show extra controls, then wire this behavior to the selection state, it should work.
Note: you will have to write some code for the expansion portion, to handle resizing it, showing the controls, and notifying the table view that one of its rows changed height. Lots of documentation and examples exist out there for each individual component of your problem. Post more specific questions as you run into roadblocks.
I will have to implement a calendar view/controller that looks pretty much like the one on iPad. Only differences are the list view and I will not have a yearly and daily view.
Also there is no interactivity in the calendar grid (no moving appointments around).
My idea is currently to have the calendar grid drawn manually in drawRect: and use customized UIViews for the events and place those on top.
Does anybody have a better idea to realize such a view?
There's a UICalendar project here which also works on iPad. You may have to fiddle with some things to get the images to stretch across the screen bounds, but the event list view works just as you'd expect:
https://github.com/Clancey/UICalendar.git
I'm interested in having a application with a layout similar to the tabbed operation of iChat (see image below).
Does anyone know of any pre-built constructs that allow this sort of UI? I know there is NSTabView for tabs across the top of the application, but what about vertical orientation? For my purposes, the view associated with the tabs doesn't necessarily need to scroll. In fact it has nothing to do with chatting anyway, I simply like this layout.
Thanks.
The view on the left is an NSTableView with source list-style highlighting:
tableView.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList;
You can use a tabless NSTabView for the right part, but you could just as well change the content of the displayed views or swap the views entirely. That depends on how many “tabs” there’ll be and how the content displayed on the right side will be different.
I got trouble to add slideshow to my application.
Currently, I have a UIView composed of a segmentedControl.
I made two "views" that I hide or display depending on the selected button.
I'm looking to make a simple slideshow in one of my two views. I made a UIImageView because it is simple to display pictures.
So I'd like to display my pictures one by one and it is possible to move from one image to another by sliding your finger to the right or left (just as in the native app "Photos").
I tried to adapt example codes from the documentation, but without succes.
So I'ml looking for help.
Thanks,
jb crestot
SO, I've actually done this and it's fairly easy. The ingredient that you are missing is a UISCrollView. My implementation did exactly what you describe (allow the user to go back and forth between a set of images).
Basically, add a UIScrollView to your View in interface builder and you will be creating the UIImage views with code (a simple for loop) and setting their images the same way. I did this safely with no memories issues with about 15 images (PNG's). There could be a potential performance issue with this message if you are working with a large number of images (say 40?)
I hope this helps, let me know if you need a code sample to see how this works.
You may consider using a custom class, such as iCarousel, linked below. Each of these views could be your image, and then tapping on them could launch a fullscreen view for example.
Keep us posted!
http://cocoacontrols.com/platforms/ios/controls/icarousel
See apple's page control sample application.