Does not always display when tableview created in UIViewController #31

Open
timothycosta opened this Issue Sep 12, 2011 · 3 comments

Comments

Projects
None yet
3 participants

This was working perfectly when I used it with a UITableViewController. But I am now trying to use it in a UIViewController, where I programmatically create the tableView. Most of the time the refresh header does not get shown, although a white area does get pulled down, and stays down while the view is refreshing.

When it does show, my table view header (not EGO) gets created twice, and the refresh header gets shown below the top duplicate header. However, even when removing my header it does not show properly.

Here is a screenshot:

https://lh6.googleusercontent.com/-eUGkPqmO4eE/Tm5OqoUBQvI/AAAAAAAABM4/ctJPGAZnEc4/s800/PulldownRefreshBug.png

Contributor

devindoty commented Sep 12, 2011

Can you show the code you're using to setup the table view and table view header?

dannewns commented Dec 2, 2011

Im having a similar issue with regards to the refresh header not getting shown my code looks like the following (im still new to iOS so dont shoot me)

setting up table view

orderHistoryTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 480) style:UITableViewStylePlain]; 
[orderHistoryTable setDelegate:self];
[orderHistoryTable setDataSource:self];

setting up egorefresh
if (pullToRefreshHeaderView == nil) {
    EGORefreshTableHeaderView *view = [[EGORefreshTableHeaderView alloc]  initWithFrame:
                                       CGRectMake(0.0f, 0.0f - self.view.bounds.size.height,
                                                  320.0f, self.view.bounds.size.height)];
    view.delegate = self;
    [self.view  addSubview:view];
    pullToRefreshHeaderView = view;
    [view release];            
}

have i missed something out, the mechanism seems to be working i.e. the white area holds for a bit and then disappears as you would expect them to.

any help would be much appreciated.
thanks

Dan

Contributor

devindoty commented Dec 2, 2011

The view is there, just the frame is a bit off. Initialization should look like this.

EGORefreshTableHeaderView *view = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, -60.0f, 320.0f, 60.0ft)];

It should also get added to the table view, not self.view, unless you're using a UITableViewController.

[orderHistoryTable addSubview:view];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment