• 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: scrolling and drawing porblems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scrolling and drawing porblems


  • Subject: Re: scrolling and drawing porblems
  • From: Ivan Kourtev <email@hidden>
  • Date: Tue, 7 Nov 2006 16:26:47 -0500

On Nov 7, 2006, at 4:11 PM, m wrote:
Then you'll probably need to do something like let the scroll view copy on scroll, then in your view's drawRect: method, draw "outside the lines" of the rect you get as a peramter. Basically redraw where your static stuff was before scrolling and where it should be after.

Unfortunately, that doesn't work for two reasons:

1. I don't know what the scroll was, in fact I don't even know whether drawRect was called because of a scrolling action. Maybe I can setup some complex logic in my view do find out whether the visible rectangle has changed but I am trying to avoid this if possible.
2. Drawing outside the drawRect's argument seems to have no effect - I think maybe the drawing gets clipped?




On Nov 7, 2006, at 12:52 PM, Ivan Kourtev wrote:

On Nov 7, 2006, at 3:43 PM, m wrote:
On Nov 7, 2006, at 12:25 PM, Ivan Kourtev wrote:

I want to have a certain object drawn at a constant position relative to the visible rectangle of my custom view (so that it's always visible). The problem was that the my custom view was in a scroll view that by default copies view content on scroll. As both you and Eric suggested one way to accomplish what I wanted was to disable the copying. Indeed, something like [[self enclosingScrollView] setCopiesOnScroll:NO]; in my custom view did the job.
The side effect of this is that since there is no copying anymore, the argument to drawRect in my custom view after scrolling is the entire visible rectangle (rather than just a small strip exposed after scrolling).

Is this a problem in fact or in theory? Put another way, are you noticing (as a user) a performance impact as a result of having to redraw the while view instead of just a bit? Depending on how complex and expensive your drawing is, you might find the code complexity required (time spent coding, fixing, maintaining) to optimize drawing doesn't pay off in substantial user perceived responsiveness.

I absolutely agree but in this particular case performance is impacted significantly indeed.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: scrolling and drawing porblems
      • From: Dietmar Planitzer <email@hidden>
References: 
 >Re: scrolling and drawing porblems (From: Erik Buck <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)

  • Prev by Date: Multiple windows/window controllers, one document and Core Data
  • Next by Date: Re: Strange interaction between IB and other running apps (Skype/Terminal in testing) Re: Problem with IB not control-dragging to make connections
  • Previous by thread: Re: scrolling and drawing porblems
  • Next by thread: Re: scrolling and drawing porblems
  • Index(es):
    • Date
    • Thread