• 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
Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]


  • Subject: Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 29 Jul 2014 19:42:42 -0700

On Jul 29, 2014, at 18:52 , Graham Cox <email@hidden> wrote:

> What I want is to have my enclosed custom view 'stick' to the top, left (or wherever it's scrolled to) of the clip view as long as it's larger than the clip view, but become horizontally and vertically centered in the clip view if it's smaller (e.g. when zoomed so that its frame shrinks). This is a fairly classic requirement, and has been solved in the past by having a custom clip view that can recognise the 'smaller than' situation and force its contained view to be centred.

Actually, I’ve never (that I recall) taken that approach, but rather constrained the “document” view (the clip view’s child) to be at least as large as the clip view —  and coincident with the clip view when they’re the same size, of course.

Then, when the content is zoomed in far enough, it can just be drawn directly on the central part of the (too-large) document view, or you can add a subview pinned to the center of the document view that’s responsible for the drawing.

There are a couple of other good reasons to draw in a clip-view-size document view, rather than a smaller view that just encloses the content:

1. If you have the ability to drag out a selection rectangle, its visible representation doesn’t stop at the edges of the central portion of the clip view.

2. IIRC, the ruler annotations stop drawing at the boundaries of the document view, which in your scenario produces blank ruler sections that can look mighty strange.

3. If there’s an inner focus-ring indication of some sort for the content area, I think it looks better drawn just inside the clip view bounds, rather than the smaller content bounds. (But I had to draw a custom indication, because it was on the inside of the view instead of the outside. Now that we have more robust outer-focus-ring drawing mechanisms, I don’t think I’d bother with the custom inside-view focus ring any more.)

_______________________________________________

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: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
      • From: Graham Cox <email@hidden>
References: 
 >Autolayout frustrations with NSOutlineView (From: Graham Cox <email@hidden>)
 >Re: Autolayout frustrations with NSOutlineView (From: Kyle Sluder <email@hidden>)
 >Re: Autolayout frustrations with NSOutlineView (From: Graham Cox <email@hidden>)
 >Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question] (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
  • Next by Date: Re: iOS 8 beta 4 messes with my TextView
  • Previous by thread: Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
  • Next by thread: Re: Autolayout frustrations with NSOutlineView [SOLVED, +follow-up question]
  • Index(es):
    • Date
    • Thread