Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7838237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:02:41+00:00 2026-06-02T15:02:41+00:00

I have a cocoa application that has a dozen scrollViews. I love the elasticity,

  • 0

I have a cocoa application that has a dozen scrollViews. I love the elasticity, especially in some cases where I’d actually put some kind of “Easter egg” (kinda like the apple logo in the books app. you scroll down, you see an apple logo.)

My problem is, that I need to limit the amount of exposed content beyond the actual content area. When I scroll with the magic mouse, especially, the elasticity causes the whole scroll content to disappear! Until you release the scroll, it moves back in.

Now, I would like to limit the elasticity to a specific margin. how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:02:42+00:00Added an answer on June 2, 2026 at 3:02 pm

    NSScrollView manages a view which has a “canvas” bigger than what is/can be display at any one time. So if you want a different behaviour:

    • Check (void)setHorizontalScrollElasticity: but that doesn’t quite do what you want. (you want to allow a fixed amount of elasticity)
    • Subclass NSScrollView to implement the behaviour you want.
    • Create your own class from scratch (well… Anything inheriting from NSResponder since you want to handle events).

    For example, I once wrote a world-map program but needed the map to loop forever on the horizontal axis. I just manually managed the scrolling with a subclassed NSView. (don’t have access to code currently)

    Something to ponder about: I understand your reasons but just wanted to mention it. The behaviour should be expected by the user. If it looks like a button, it should act like out. Currently, scrollviews have the elasticity so that when they scroll via momentum (user is no longer touching), it doesn’t stop suddenly once it reaches the end… which would be jarring for users.


    Example
    If subclassing NSScrollview, I would try overriding - (void)scrollWheel:(NSEvent *) and detect what are the bounds of the contentView and cap it at a certain value. Something around the lines of:

    - (void)scrollWheel:(NSEvent *)event
    {
        [super scrollWheel:event];
        if (self.contentView.bounds.origin.y > SomeConstant)
             /* cap the value */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a small Cocoa problem. I have a StatusBar application that has an
I have a cocoa application that has a finder like feel it and is
I have a cocoa application that has a view which is clickable. I cannot
I have a document-based Cocoa application that has to start up a sub-process before
I have a Cocoa application that records datestamps on events. I need to know
I have a Cocoa application that, periodically, needs to install pkg X onto the
I have a Cocoa, Document-based Mac OS X application. One feature that I have
I have a cocoa application which has certain subroutines / methods. So if I
I have created a gaming application that has only one window. Application is created
I am trying to create an mac application in XCode that has some of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.