Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-10-2009, 10:51 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 16
Default Scrollbar indicators disappear?

Hi,

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--

Last edited by byteeater; 11-10-2009 at 11:17 AM.
byteeater is offline   Reply With Quote
Old 11-10-2009, 04:21 PM   #2 (permalink)
Humbled Student
 
Dutch's Avatar
 
Join Date: Apr 2009
Location: Long Island, NY
Age: 32
Posts: 883
Send a message via AIM to Dutch
Default

Quote:
Originally Posted by byteeater View Post
Hi,

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?
Dutch is offline   Reply With Quote
Old 11-11-2009, 08:04 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 16
Default

Yes... maybe I try to completely remove the UIScrollView and re-add it...
byteeater is offline   Reply With Quote
Old 12-22-2010, 04:46 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 3
Default

Quote:
Originally Posted by byteeater View Post
Hi,

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.
dalewking is offline   Reply With Quote
Old 12-22-2010, 05:09 PM   #5 (permalink)
Registered Member
 
Join Date: Dec 2010
Location: Kansas
Posts: 12
Default

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.
sringel is offline   Reply With Quote
Reply

Bookmarks

Tags
disappear, scrollbars, uiscrollview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:15 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0