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 568489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:11:38+00:00 2026-05-13T13:11:38+00:00

I’m trying to use the IKImageViewDemo provided by apple ( http://developer.apple.com/mac/library/samplecode/IKImageViewDemo/index.html ) and I’m

  • 0

I’m trying to use the IKImageViewDemo provided by apple (http://developer.apple.com/mac/library/samplecode/IKImageViewDemo/index.html) and I’m trying to add scrollbars to it. I’ve tried two things:

1) embedding the IKImageView in a ScrollView. This had all sorts of weird effects, like the image was no longer located where it should have been, and the scrollbars seemed to be in a fixed place, no matter how big the window was (So I could shrink the window and lose the scrollbars, even though the scrollview was set to resize with the window)

2) I added [_imageView setHasHorizontalScrollers: YES] (and vertical) into the code in the openImageURL method. This appears to have done nothing.

Am I missing something obvious?

Additionally: Why does

NSLog(@"scrollbar? H %d V %d hide %d", 
      _imageView.hasHorizontalScroller, 
      _imageView.hasVerticalScroller,
      _imageView.autohidesScrollers);

_imageView.hasHorizontalScroller = YES;
_imageView.hasVerticalScroller = YES;
_imageView.autohidesScrollers = YES;

NSLog(@"scrollbar? H %d V %d hide %d", 
      _imageView.hasHorizontalScroller, 
      _imageView.hasVerticalScroller,
      _imageView.autohidesScrollers);

give me:

scrollbar? H 0 V 0 hide 0
scrollbar? H 0 V 0 hide 0

?

Additionally additionally:

Equivalently why does:

 BOOL b = _imageView.autohidesScrollers = YES;
 NSLog (@"b %d scrollers %d", b, _imageView.autohidesScrollers);

print b 1 scrollers 0 ?

  • 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-05-13T13:11:39+00:00Added an answer on May 13, 2026 at 1:11 pm

    One thing that may have been catching you up in IKImageViewDemo was that the image was zoomed to fit in the windowDidResize: method ([_imageView zoomImageToFit: self]).

    Embedding the IKImageView in a NSScrollView is the right thing to do. In order to get the scrollbars to follow the window as you resize it, you need to adjust the springs and struts (== autoresizing mask) in Interface Builder.

    Addendum: As you’ve noticed, there is a bug in Mac OS X 10.6 that causes this not to work properly. You can work around the problem by subclassing the NSScrollView as follows:

    @interface IKImageClipView : NSClipView
    - (NSRect)docRect;
    @end
    
    @implementation ScrollViewWorkaround
    
    - (void)reflectScrolledClipView:(NSClipView *)cView;
    {
        NSView *_imageView = [self documentView];
        [super reflectScrolledClipView:cView];
        if ([_imageView isKindOfClass:[IKImageView class]] &&
             [[self contentView] isKindOfClass:[IKImageClipView class]] &&
             [[self contentView] respondsToSelector:@selector(docRect)]) {
            NSSize docSize = [(IKImageClipView *)[self contentView] docRect].size;
            NSSize scrollViewSize = [self contentSize];
            // NSLog(@"doc %@ scrollView %@", NSStringFromSize(docSize), NSStringFromSize(scrollViewSize));
            if (docSize.height > scrollViewSize.height || docSize.width > scrollViewSize.width)
             ((IKImageView *)_imageView).autohidesScrollers = NO;
            else
             ((IKImageView *)_imageView).autohidesScrollers = YES;
        }
    }
    
    @end
    

    Try this out:

    http://dl.dropbox.com/u/1583683/IKImageViewDemo.zip

    It’s a version of IKImageViewDemo with scroll bars and the above workaround.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.