Re: NSScrollView Problems
Re: NSScrollView Problems
- Subject: Re: NSScrollView Problems
- From: Kyle Sluder <email@hidden>
- Date: Sat, 02 Feb 2013 21:58:35 -0800
Unbalanced +[NSGraphicsContext saveGraphicsState] in your custom view's -drawRect? (Or in one of its subviews'?)
--Kyle Sluder
On Feb 2, 2013, at 9:19 PM, Patrick Cusack <email@hidden> wrote:
> You can see an example of the problem here:
>
> http://i45.tinypic.com/fu8bpz.png
>
> On Feb 2, 2013, at 8:06 PM, Graham Cox wrote:
>
>>
>> On 03/02/2013, at 1:59 PM, Patrick Cusack <email@hidden> wrote:
>>
>>> Sorry, I have asked this before, but I am genuinely perplexed and need help. I have an NSScrollView enclosing a custom view. When, I launch my application, I see the scroll bars of my NSScrollView being echoed or duplicated in the middle of my custom view. It is so annoying. I have tried everything I can to figure out why it is doing it. Has anyone ever seen this? I have been slowly pulling things out of my model, but the only thing that keeps it from happening, is if I completely hide the scrollbars, but then I need to add logic to scroll the view inside the scrollview.
>>
>>
>> Well, I've never seen this happen despite using NSScrollView extensively.
>>
>> So that suggests that there is something a bit strange with the way you're creating it, or setting it up.
>>
>>
>> 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.
>>
>> 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.
>>
>> Does anything in your code "fiddle" with the scrollview? There is rarely a need to. Have you subclassed it, and overridden something like -tile?
>>
>> 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.
>>
>>
>> --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
_______________________________________________
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