• 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: How to get a scroll view to recognize overflow on a custom view?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a scroll view to recognize overflow on a custom view?


  • Subject: Re: How to get a scroll view to recognize overflow on a custom view?
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 23 Mar 2009 05:33:15 -0400

Thanks Quincey this helped. I'm getting scroll bars now.

The new issue though is that when I set the size of the content view (document view?) the scroller's size changes to the new size of the content. I've checked and rechecked to make sure all the autosize parts are set up in IB correctly, but no matter what I do, I can't both set the size of the scroller content view and preserve the frame of the scroll view.

Here's how I set up the autosize options in IB

Scroll view options:
outside:
	top, left, bottom, right
Inside
	scale width, scale height

Content view options:
Outside:
	top, left, right
Inside:
	scale width

In my code, the content view recalculates it's height when the contents are refreshed with new data. The new data comes from the result of database searches and I display te results in the content view.

When I change the height, the scroll view always changes as well. How can I resize the contents of a scroll view without also changing the size of the scroll view that contains it?




On Mar 23, 2009, at 1:50 AM, Quincey Morris wrote:

If scroll bars don't appear, there are 2 likely causes:

-- You are failing to set your custom view's "depth" properly. The depth is determined by your custom view's frame. Make sure you're setting the frame to the correct height (and not, for example, setting just the bounds to the desired height).

-- The autoresize flags for your custom view are causing it to be resized because the enclosing scroll view is being resized as part of the window setup. If you want to control the view frame height yourself, make sure the vertical autoresize widget for the custom view in IB is not set to change the view height. You may want to also turn off the scroll view's "resizes subviews automatically", unless you want the width of your view to match the scroll view automatically.

Note that the non-appearance of the scroll bar most likely results from the above in combination with the "hides scroll bars automatically" option for the scroll view in IB. If you uncheck that, you should see the scroll bar, but the scroll bar would then be inactive if you don't maintain the view height correctly.
_______________________________________________

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: How to get a scroll view to recognize overflow on a custom view?
      • From: Quincey Morris <email@hidden>
References: 
 >How to get a scroll view to recognize overflow on a custom view? (From: Ken Tozier <email@hidden>)
 >Re: How to get a scroll view to recognize overflow on a custom view? (From: Quincey Morris <email@hidden>)

  • Prev by Date: De-Mystifying NSCell
  • Next by Date: Binding NSMatrix to user Defaults
  • Previous by thread: Re: How to get a scroll view to recognize overflow on a custom view?
  • Next by thread: Re: How to get a scroll view to recognize overflow on a custom view?
  • Index(es):
    • Date
    • Thread