PDA

View Full Version : Attempting a weather-like UI of movable tableviews




beachdog
Nov 6, 2008, 12:25 PM
I want to accomplish a UI somewhat similar to the weather app, where you can slide the cities/locations back and forth in and out of view. In the case of the weather app, each city seems to be represented by a tableview. In the case of my app, I also have several tableviews that I want similarly to be laid horizontally side by side, and have the user slide them back and forth.

I understand a bit about the UITouches interface that will be necessary for this, but my question has to do with how can I overide the default touch behavior that tableviews already exhibit? For instance, if I swipe a tableview horizontally, that is used to display the delete button over the cell I swiped. In this app however, I would not want that -- I want instead to receive that touch notification so I can start repositioning the view under the user's finger to give the visual feedback of shifting the entire view in one direction and uncovering a new tableview that slides in. Is there a way I can get touch notifications for anywhere on the application window, without them being "stolen" by the tableview underneith? And if I can, the other side of the problem is that I still do want notifications such as when the user presses a cell because I in fact still will have operations like delete of a cell.

Any general thoughts on how to do this? I'm not so much looking for specific code as much as just any knowledge about best general approach.



imPoddible
Nov 7, 2008, 12:35 PM
I want to accomplish a UI somewhat similar to the weather app, where you can slide the cities/locations back and forth in and out of view.

I'd also like to find out how to do this. Any pointers to sample code, etc. would be useful.

Thanks,

imPoddible.

cpatch
Nov 7, 2008, 03:21 PM
I'm not at my Mac and haven't done this before but I think you want to use a ScrollViewContainer and PageControl. Then disable editing for the table unless the user taps an Edit button.

Look at Apple's PageControl sample and also here:

http://iphone.zcentric.com/2008/10/08/view-images-like-photosapp

Craig