Re: NSTableView with reversed rows?
Re: NSTableView with reversed rows?
- Subject: Re: NSTableView with reversed rows?
- From: Jonathan Mitchell <email@hidden>
- Date: Thu, 02 Oct 2014 21:21:54 +0100
On 2 Oct 2014, at 20:45, Luc Van Bogaert <email@hidden> wrote:
> Hi,
>
> I would like to implement a table (in a scrollview) where the first row
>displays at the bottom instead of at the top, the second row above the first
> and so on. How would I go about to accomplish this?
>
> I've tried overriding 'isFlipped' in a subclass of the scrollview and the
>tableview but that didn't seem to make any difference. I didn't think it
>would be that easy anyway, but I have no idea where to start...
I would try creating a vertical container NSView (Or an NSStackView for that
matter) that contains two vertical subviews:
1. The first view is a blank placeholder constrained to be the same width and
(height - NSTableView rowheight) as the NSScrollView content view. This forces
the table view down.
2. An NSTableView instance bound to array of data items in reverse order via an
NSArrayController. When adding items to the NSArrayController call -
(void)insertObject:(id)object atArrangedObjectIndex:(NSUInteger)index with a zero
index.
You will also have to figure out how to configure the vertical container within the
NSScrollView.
This sort of thing.
http://stackoverflow.com/questions/4599747/programmatically-creating-an-nstableview-trouble-getting-the-nsheaderview-to-sh
It might get you started.
J
_______________________________________________
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