Stacking views
Stacking views
- Subject: Stacking views
- From: Gernot <email@hidden>
- Date: Fri, 15 Feb 2008 13:08:22 +0100
Hello,
I have a seemingly simple request, but unfortunately I can't find any
definitive Information on it. I need to have a view that stacks its
subviews in top of each other. Like a TableView. It gets its
represented Objects from an NSArrayController, and assigns it to some
View that it then adds as a subview. It also cares about the
selection, scrolling and so on. But the difficult point is that those
views can have different heights, dependent on their
representedObject. In some way the view stacking is similar to what's
done in Java's Swing for years. I know multiple approaches for it,
each with its caveats, and I'm not sure about which route to take:
NSTableViews/NSOutlineViews:
They don't use Subviews, they use Cells. As I want to use
CoreAnimation to move subviews around, this is a bit of a drawback.
However, Tables let me have rows with different heights, which is
important. I can use Cells which control views, but in this age of
CoreAnimation is this really the way to go?
NSCollectionView
This is almost perfect except that all subviews have the same size.
Overriding the layout mechanism to enable differently sized subviews
is less than trivial.
Using CALayoutManager
This will work for implementing the layout logic, but I will have to
do all the binding to the ArrayController with the represented Objects
myself, including selection, etc.
Doing it all from scratch
Is it really necessary to do it the hard way? Isn't there anything by
Apple or someone else that lets me stack views, bind them to an
ArrayController, update selections, etc, and animate everything nicely
with CoreAnimation?
I think I propably overlooked the obvious solution. Thanks in advance
for pointing me in the right direction!
Cheers,
Gernot.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden