I've a strange problem. I work with an UIScrollView which stores multiple UIView as subviews inside. Everything is fine, I have scrollbars, no problem. Then on a user input "next page" I remove all subviews from my UIScrollView and fill it with new subs. But then... the scrollbar indicators are not shown any longer.... they're gone!?
++++
I realized that this behaviour only occurs if I really scroll the (vertical) scrollbar. So 1) alloc UIScrollView 2) add subviews 3) remove subviews 4) add new subviews ==> scroll = works! --- BUT 1) alloc UIScrollView 2) add subviews 3) scroll the view 4) remove subviews 5) add new subviews ==> scroll = DOES NOT WORK (scrollbar is simply not there...) !
++++
I've a strange problem. I work with an UIScrollView which stores multiple UIView as subviews inside. Everything is fine, I have scrollbars, no problem. Then on a user input "next page" I remove all subviews from my UIScrollView and fill it with new subs. But then... the scrollbar indicators are not shown any longer.... they're gone!?
++++
I realized that this behaviour only occurs if I really scroll the (vertical) scrollbar. So 1) alloc UIScrollView 2) add subviews 3) remove subviews 4) add new subviews ==> scroll = works! --- BUT 1) alloc UIScrollView 2) add subviews 3) scroll the view 4) remove subviews 5) add new subviews ==> scroll = DOES NOT WORK (scrollbar is simply not there...) !
++++
Any idea?
Best Regards,
b--
Are you re-setting the UIScrollView.contentSize after each time you add subviews to it?
I've a strange problem. I work with an UIScrollView which stores multiple UIView as subviews inside. Everything is fine, I have scrollbars, no problem. Then on a user input "next page" I remove all subviews from my UIScrollView and fill it with new subs. But then... the scrollbar indicators are not shown any longer.... they're gone!?
You probably don't care anymore, but in case someone else finds this post, the reason is that the scroll bars are actually subviews of the UIScrollView. When you removed all subviews, you also removed the scroll bars.
I'm trying to figure out how to determine if a subview is the scrollbar or one of my subviews.
I ran into this as well, and I found that I had some code that was supposed to loop through the views and remove the ones that were not needed was removing the scrollview indicators as well. They are apparently a subview of the UIScrollView of type UIImageView. I was able to work around it by setting the tag to something other than 0 on the views I was adding and then in the method that removes views checking the tag and only removing the views with that tag.