Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

  1. I have a UIScrollView of size 320*460 and with content size 1024*1024.
  2. I can place 25 images of 256*256 in it with the 13th picture shown at the centre of the screen when it loades with bits of surrounding pictures around it.
  3. When i swipe to any side I want it to appear just like the mapView. With new images appearing and showing.

How can I do it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
372 views
Welcome To Ask or Share your Answers For Others

1 Answer

It's very easy & somewhat tricky...

You don't need to define the specific size for the ScrollView.....

Generally we use to define ....as per the Examples of Apple

//#define SCROLLVIEW_CONTENT_HEIGHT 460

//#define SCROLLVIEW_CONTENT_WIDTH  320

which is of no use...if you need the infinite height..

just set the height of the ScrollView dynamically as per the Objects added to the ScrollView....

No need to set the predefined height for this...take the dynamic height....

scrollview.contentSize = CGSizeMake(320, txtView.contentSize.height+450);
 CGPoint topOffset = CGPointMake(0,0);
 [scrollview setContentOffset:topOffset animated:YES];

Hope this will surely work for you..

Good Luck :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...