Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
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



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

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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.