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 08-31-2009, 05:07 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
Default UIScrollView

i have created a uiscrollview in interfacebuilder.

UILabel inside of UIScrollView inside of UIView

therefore im trying to insert a large amount of text into the label,
allow the users to scroll through the giant text, but the uiscrollview that i created is just keep bouncing back to the top, it wont scroll normal like the uitableview.


can anyone give me a hint of how to do this? or example from apple?
svveet is offline   Reply With Quote
Old 08-31-2009, 06:41 AM   #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

Once your label is "FULL" of text, you need to measure how wide and high it is.

Then you need to call
Code:
[theScrollView setContentSize:CGSizeMake(w, h)];
This will let the scrollview know the size of it's content so it knows how to behave when scrolling. Just adjust the W and H as needed.
Dutch is offline   Reply With Quote
Old 08-31-2009, 09:47 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
Default

its still bounce back to the top of the view when i try to view the rest of the text.

what does uiscrollview delegate do?
svveet is offline   Reply With Quote
Old 08-31-2009, 09:56 AM   #4 (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 svveet View Post
its still bounce back to the top of the view when i try to view the rest of the text.

what does uiscrollview delegate do?
Here is a link to the UIScrollView Delegate Protocol Reference.

However, they shouldn't be needed for such things. Try setting

Code:
[theScrollView setContentSize:CGSizeMake(1000, 1000)];

and see if it still bounces back.
Dutch is offline   Reply With Quote
Old 08-31-2009, 08:39 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
Default

Quote:
Originally Posted by Dutch View Post
Here is a link to the UIScrollView Delegate Protocol Reference.

However, they shouldn't be needed for such things. Try setting

Code:
[theScrollView setContentSize:CGSizeMake(1000, 1000)];

and see if it still bounces back.
Yeap, that solved my problem...i didnt know i had to set those things at the beginning, thanks
svveet is offline   Reply With Quote
Reply

Bookmarks

Tags
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
» Online Users: 285
18 members and 267 guests
2WeeksToGo, ADY, Creativ, dacapo, Dani77, Fritzer, ghost, HDshot, headkaze, iDifferent, mer10, mystic.purple, Rudy, smethorst, stoneage, superg, tathaastu, Zool
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,878
Threads: 89,224
Posts: 380,732
Top Poster: BrianSlick (7,129)
Welcome to our newest member, olga2000
Powered by vBadvanced CMPS v3.1.0

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