2

In my app, I have part of a view sticking out from the right. I would like the user to be able to swipe that to the left, to pull/reveal the rest of that view, which would basically almost cover the screen. See below:

First Scroll view with small view on right

Second scroll view which has been swiped to cover screen

I am figuring my best option is to use UIScrollView for two reasons. That I can lock the movement to horizontal only, and the animation for swiping is already built it.

My question is, can I have one page of the UIScrollView smaller than the other as shown in my mockup images?

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
  • possible duplicate of [UIScrollView horizontal paging like Mobile Safari tabs](http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safari-tabs) – Thomas Clayson Feb 08 '11 at 17:02
  • But as you can see in my first mockup, I only want part of the scrollview showing. To the left of it is another layer (MapView) that needs to allow the user to interact with, so only the right part can be the scrollview or else it would cover up the map. It seems that the Mobile Safari tabs link does not help with this. – Nic Hubbard Feb 09 '11 at 00:12
  • Setting clipToBounds = NO does just what I need. But the UIScrollView is still only on part of my screen.. – Nic Hubbard Feb 09 '11 at 01:16

1 Answers1

3

UIScrollView horizontal paging like Mobile Safari tabs

Community
  • 1
  • 1
Thomas Clayson
  • 29,657
  • 26
  • 147
  • 224
  • But as you can see in my first mockup, I only want part of the scrollview showing. To the left of it is another layer (MapView) that needs to allow the user to interact with, so only the right part can be the scrollview or else it would cover up the map. It seems that the Mobile Safari tabs link does not help with this. – Nic Hubbard Feb 09 '11 at 00:14
  • right... as far as i understand (from reading and rereading lol) You have a map in the light gray area and another view on the right? Can't you test for swipe events on the mainly hidden view? then slide that in if theres a right to left swipe? just animate it to origin 0,0. Then test for left to right swipes to send it back again. – Thomas Clayson Feb 09 '11 at 10:36
  • ok, well can you put a scroll view in which has just a blank view on the left and your content on the right, and then put the map above the scroll view in a new layer? You'll have to do some fancy maths and animation and such, but it could work? – Thomas Clayson Feb 10 '11 at 09:49