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

  • SEARCH
  • Home
  • 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 8937799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:28:41+00:00 2026-06-15T10:28:41+00:00

I have a weird bug concerning an UIScrollView. This view works fine, until the

  • 0

I have a weird bug concerning an UIScrollView. This view works fine, until the moment I remove it from the window (indirectly, it’s a subview to a removed view).

I then perform some unrelated animation ; and when I put the views where they were, the scrollView’s contentOffset has changed.

I put a breakpoint in setContentOffset: function, and got the following stack :

#0  -[TestScrollView setContentOffset:] (self=0x915fbd0, _cmd=0x7fb34cd, contentOffset={x = 80, y = -0}) at /Users/../TestScrollView.m:19
#1  0x008670ea in -[UIScrollView(Static) _adjustContentOffsetIfNecessary] ()
#2  0x0085db55 in -[UIScrollView(UIScrollViewInternal) _stopScrollingNotify:dealloc:pin:] ()
#3  0x0084e6ff in -[UIScrollView _didMoveFromWindow:toWindow:] ()
#4  0x008444bb in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#5  0x008444bb in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#6  0x008444bb in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#7  0x008444bb in -[UIView(Internal) _didMoveFromWindow:toWindow:] ()
#8  0x00840c72 in -[UIView(Hierarchy) _postMovedFromSuperview:] ()
#9  0x0083f4c6 in __UIViewWasRemovedFromSuperview ()
#10 0x0083f141 in -[UIView(Hierarchy) removeFromSuperview] ()
#11 0x00166573 in __98+[App MyAnimationLaunchingMethod]_block_invoke_0 ...

I saw other questions when a scrollview changes its own contentOffset from a call to _adjustContentOffsetIfNecessary, for instance after a setFrame.
However it doesn’t seem to make any sense here, as its size doesn’t change : it is just taken off from the screen (to be put on back later). So there’s no reason for it to change its offset.

Is there some explanation to this ? Some way to prevent this change ?

I could block (or restore) manually the offset change, however I’m looking for a “clean” solution if available : it’s a whole group of views which are removed from the window. Sometimes this particular scrollView is present in the views tree, usually not.. So the animation class should not know about the scrollview.

Any idea ?

Thanks in advance

  • 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-15T10:28:42+00:00Added an answer on June 15, 2026 at 10:28 am

    Kind of a hack, but you can put a test in your setContentOffset: and simply return if it has already been removed from its superview.

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

Sidebar

Related Questions

Okay, I have a bit of a weird bug... This works fine: private void
I have a weird problem. I create this window, but its blank until i
I have this really weird bug. When I scroll down my table view, down
This query below works but i seem to have a weird bug. The first
I have this supper weird bug, where this method fails in IE9. What is
This has been driving me nuts all day. I have a weird bug that
Hey fellas, I have this weird bug, and I have no clue how to
I have this weird bug that I cannot fix. Can anyone help me? Thank
I have this weird bug, where C++ calls the wrong function: So this bit
I have this really weird bug at my page. I wrote this comment system

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.