• 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: Large over 100K pixel high ruler scroll view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Large over 100K pixel high ruler scroll view


  • Subject: Re: Large over 100K pixel high ruler scroll view
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 23 Aug 2011 17:09:07 -0700

On Aug 23, 2011, at 4:19 PM, Julie Porter wrote:

>> Your best bet is to not completely dump IB, but to simply set the contentSize programatically as soon as you load your document.
>>
> This is what I am having issue with.    How and where to put the delegates?  Specifically what file would I place them into?  Or do I create a new file for the delegate that does this?

The scroll view will set its scrolling range based on the size of the frame of its embedded document view, which is the view that you draw into. So there’s no need to set a document size in IB. Just make the document view an instance of your custom view class (drag in a Custom View object, set it to your class, then do Embed In Scroll View).

At runtime when you load the data your view can calculate how large it needs to be and set its frame rect appropriately. The scroll view will detect that and change the scroll range.

One warning about extremely large views is that at some point you will run into floating-point rounding errors, since AppKit and CoreGraphics coords are 32-bit floats and have only 24 bits of precision. Still, that should get you to millions of pixels before the coords stop being pixel-accurate.

—Jens_______________________________________________

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: Large over 100K pixel high ruler scroll view
      • From: email@hidden
References: 
 >Large over 100K pixel high ruler scroll view (From: Julie Porter <email@hidden>)
 >Re: Large over 100K pixel high ruler scroll view (From: Thomas Davie <email@hidden>)
 >Re: Large over 100K pixel high ruler scroll view (From: Julie Porter <email@hidden>)

  • Prev by Date: Re: Large over 100K pixel high ruler scroll view
  • Next by Date: Re: Large over 100K pixel high ruler scroll view
  • Previous by thread: Re: Large over 100K pixel high ruler scroll view
  • Next by thread: Re: Large over 100K pixel high ruler scroll view
  • Index(es):
    • Date
    • Thread