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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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-24-2010, 08:58 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 6
-Jeka- is on a distinguished road
Default A very strange scrolling in UIScrollView

I create UIScrollView through the IB, put it into the position by setting its own property frame into values (x = 80, y = 58, width = 240, height = 266). Then I specify it through the property contentSize (also I've tried to do that through setContentSize ) the size of the content (width = 253, height = 279). The content is bigger than the visible one in 13 horizontally and vertically. Then I draw square boxes (size 13х13) and fill only the visible area !!!. I scroll down. I watch at the variable contentOffset through NSLog in the repainting drawRect function in UIScrollView. When I shut one square box while scrolling down (size 13), for example horizontally (parameter х) then I see in the console that the contentOffset.х is equal to 7 !!! And to see contentOffset.х == 13 in console's log, it is necessary to scroll in such a way, that two square boxes will be shut (size 13, that is 26). I don't understand anything here !!! Does anyone know the trick? I draw square boxes with the help of Сore Graphics libraryAlso while repainting
Here are the screenshots with the situation described earlier:

http://img.skitch.com/20101118-xyjgy...16b2d4y8a6.png
http://img.skitch.com/20101118-pxt93...n9ibsp4pnh.png
http://img.skitch.com/20101118-psh4b...y9j7p7kdr5.png
http://img.skitch.com/20101118-e55yr...64ubqaaars.png

Here is the code that takes out the whole Debug info in Console Window:

CGPoint offSet = [self contentOffset];
CGSize contSize = [self contentSize];
CGRect frame = [self frame];
CGPoint Center = [self center];

NSLog(@"Draw Cell size x: %d y: %d", m_cellSize.cx, m_cellSize.cy);
NSLog(@"Main Cells offset x: %f y: %f", offSet.x, offSet.y);
NSLog(@"Draw rect x: %f, y: %f, width: %f, height: %f", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
NSLog(@" Main Frame size x: %d y: %d", (int)(frame.size.width), (int)(frame.size.height));
NSLog(@" Main content size x: %d y: %d", (int)contSize.width, (int)(contSize.height));

m_cellSize - the size of drawing cell, width dimensions 13x13.

PLEASE HELP !!!
-Jeka- 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: 376
6 members and 370 guests
HemiMG, Kirkout, MarkC, Sami Gh, SamorodovAlex, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

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