• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stacking views
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Stacking views
      • From: Seth Willits <email@hidden>
    • Re: Stacking views
      • From: Andreas Mayer <email@hidden>
    • Re: Stacking views
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Strategies to prevent class name clashes
  • Next by Date: Re: KVC and KVO for arrays
  • Previous by thread: Re: Front and back flip animation
  • Next by thread: Re: Stacking views
  • Index(es):
    • Date
    • Thread