Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPScrollView resizes on first scroll

#35

When I create a basic scroll view with code like this:

var scrollView = [[CPScrollView alloc] initWithFrame:CPRectMake(0, 0, 500, 150)];
var docView = [[CPView alloc] initWithFrame:CPRectMake(0, 0, 500, 300)];
[scrollView setDocumentView:docView];
[scrollView setHasHorizontalScroller:NO];
[[self contentView] addSubview:scrollView];

the CPScrollView adjusts it's height when I start scrolling. The change in height appears to be equal to the size of the horizontal scroller.

If I swap the setDocumentView: and setHasHorizontalScroller: call however, it works as expected without resizing.

var scrollView = [[CPScrollView alloc] initWithFrame:CPRectMake(0, 0, 500, 150)];
var docView = [[CPView alloc] initWithFrame:CPRectMake(0, 0, 500, 300)];
[scrollView setHasHorizontalScroller:NO];
[scrollView setDocumentView:docView];
[[self contentView] addSubview:scrollView];

Reported by Bob Warwick · September 12th, 2008 @ 10:58 PM

State: resolved
Milestone: 0.5.2
Assigned to: Francisco Tolmasky Francisco Tolmasky

Activity

  1. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved

    (from [ac4faf3a4c587e7b4e2f35a5f6394cb2a101f740]) Fix for scrollers not updating properly.

    [#35 state:resolved]

    Reviewed by ross. http://github.com/280north/cappu...

    October 4th, 2008 @ 01:21 PM

  2. Francisco Tolmasky
    Francisco Tolmasky
    • Assigned user set to Francisco Tolmasky
    • State changed from resolved to open

    October 4th, 2008 @ 01:22 PM

  3. Francisco Tolmasky
    Francisco Tolmasky
    • State changed from open to resolved

    October 4th, 2008 @ 01:22 PM

  4. Francisco Tolmasky

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.