Re: NSScrollView Problems
Re: NSScrollView Problems
- Subject: Re: NSScrollView Problems
- From: Patrick Cusack <email@hidden>
- Date: Sat, 02 Feb 2013 20:56:52 -0800
> In IB, you can either add a scroll view than add a custom view to it, or add a custom view and then use 'Embed in Scrollview' to wrap it in the scrollview. Both work fine for me.
I have embedded a custom view inside an NSScrollView. I have set the NSScrollview to be NSViewWidthResizable, as well as NSViewHeightResizable as well NSViewMin X & Y as well as NSViewMax X &Y anchored. I did all this using the springs and struts, not programmatically.
>
> The next thing to check is the sizing settings. Are you using classic springs and struts or the newer constraints? I'm afraid I don't yet have any experience with the new thing, only springs and struts. The scroller should usually be set to expand and stick to all four sides of its enclosing view, but the custom view within is usually of a fixed size, and this might change programmatically according to your content. There's no reason to change any other setting, such as the scrollbars or the clip view of the scrollview.
> Whether your custom view is flipped or not will affect the way the scrollview behaves - something to check.
Changing my embedded NSView's isFlipped to "NO" makes no difference (other than the flipped coordinates).
> Does anything in your code "fiddle" with the scrollview? There is rarely a need to. Have you subclassed it, and overridden something like -tile?
I call the following in my windowControllerDidLoadNib:
[[scrollView contentView] setCopiesOnScroll:NO];
[theView scrollPoint:NSMakePoint(400, 100)];
>
> You could try starting a fresh project and quickly trying to put together a simple scrollview without any special code and verify it works, then look for what difference there is in your project that changes that.
Should I be calling [ setNeedsDisplay:YES] on my CustomView or on my NSScrollView?
>
>
> --Graham
>
>
_______________________________________________
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