views:

3040

answers:

6

Hi folks!

This inquiry is rather difficult for me to properly phase, but I'm going to give it a shot either way.

I'm currently trying to figure out how to set my UITableView's to scroll over a background, and not within their own bounds. What I mean by that, is if you look at the Tumblr application, screenshot here: http://dl-client.getdropbox.com/u/57676/screenshots/tumblrbg.jpg,

The actual UITableView above scrolls elegantly against a background, the dotted tiles. The entire table moves in unison, if that makes sense. The default behavior of a UITableView when scrolled in other cases looks more like the following screenshot: http://dl-client.getdropbox.com/u/57676/screenshots/uitableview.jpg

Notice the abundant white space at the bottom of the UITableView? That screenshot was taken with my dragging the UITableView up as far as I could. Instead of the last cell just dragging with the entire UITableView, the offset at the bottom gets created.

I'm curious what the trick is in the case of the Tumblr application to get the UITableView to scroll with all cells in unison, without creating the abundant white space in the header or footer (depending which vertical direction you scroll in). Is it a UITableView that's sitting on top of a UIScrollView? (I know UITableView is a subclass of UIScrollView, so I figured this would be poor design).

Thanks for the solution, this one is driving me up a wall.

A: 

You can find sample code here.

Jaka Jančar
+2  A: 
PyjamaSam
Chris that's almost identical to what I'm looking for. The tableView scrolling over a background image is deal. Having the cells all scroll in unison without leaving the excess white space is second. (Can't tell in your example above if it does that). Tumblr does it perfectly.
Steve: Head to the app store. Download Capsuleer. The headlines stuff you see above doesn't need an EVE Online account, so you'll be able to see if it does what you want. If it does I'll sort out a code example for you.chris.
PyjamaSam
Chris: First off, beautiful application. I love it. Second, that is exactly what I need. The table as depicted under the 'Skills' capsule is the effect I'm trying to achieve. Totally love what you did the the header there also. Feel free to drop a solution here, and I'd be willing to donate money if you have PayPal as a courtesy as well.
Steve: Thanks. I won't really have much time to get the code sorted out till Tuesday night. (though I might be able to sort it out tuesday during the day). Hope that time lines ok with you. I'll post it up here when I do.chris.
PyjamaSam
Hey Chris, I'm in absolutely no position at all to tell you when to provide a solution. :-) If anything, I'm very appreciative that you're doing it at all. Thanks a ton. PS: just started following you on Twitter also.
+4  A: 

Ok here we go. Just a quick and dirty example...

http://www.chrisandtennille.com/code/TableTest.zip

Basically a TableView overtop of a ImageView. Background of the TableView is set to be transparent.

Now it works better when the you provide a better cell then the default one.

But you get the gist.

This isn't exactly the approach I use in Capsuleer - I ended up writing my own table system to get better scrolling performance as well as the ability to have expandable "sections".

Hopefully this gets you going down the right direction.

If you have any other questions let me know, I'll do my best to help.

chris.

PyjamaSam
A: 

Hi PyjamaSam,

Fantastic application. I was googling for making a tableview which can have expandable sections and came across this post. It is more than 5 days now that i was searching for an example on making a tableview with expandable sections. I couldnot find even a single app doing that in appstore and by chance i came across this post.Immediately I downloaded your app Capsuleer and i must say its awesome.As a developer i can understand the hardwork you have done in making the components work like that.

I would be very thankful to you if you can share the idea of making tableview with expandable sections.

Awesome applications man loved the GUI.I cant stop praising it.

+1  A: 

This is fairly straight forward and doesn't require custom tables. In your UITableViewController subclass you can add this in loadView:

- (void)loadView {
    [super loadView];
    self.tableView.backgroundColor = [UIColor clearColor];
    self.view.backgroundColor = [UIColor colorWithPatternImage:yourPatternImage];
}
Caged
A: 

How can i make expendable sections?

jameel Khan