Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not always display when tableview created in UIViewController #31

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

Comments

@timothycosta
Copy link

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

@devindoty
Copy link
Contributor

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

@dannewns
Copy link

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

@devindoty
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants