简体   繁体   中英

Scrolling UITableView on the iPhone as seen in the Tumblr app?

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.

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.

If I am understanding what you are trying to do, just set the background of the UITableView to be clear and put your background behind it.

I was doing that in my application until I gave up on the UITableView and wrote my own.

For example:

alt text http://capsuleer.evesuite.com/images/screenshots/feedlist.jpg

The scan lines below the EVE Blog Pack section are the background and don't scroll. The sections and rows move over top of it.

If you need more specifics let me know, I can hobble together an example.

chris.

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];
}

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.

您可以在此处找到示例代码。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM