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

SetTitle not work first pull #291

Open
anhhtbk opened this issue Aug 30, 2016 · 2 comments
Open

SetTitle not work first pull #291

anhhtbk opened this issue Aug 30, 2016 · 2 comments

Comments

@anhhtbk
Copy link

anhhtbk commented Aug 30, 2016

I set custom title for pullRefresh. But when I pull first time, it not work, app still show default title.
After, when I continue pull, it work, app show my custom title.

[_tableView addPullToRefreshWithActionHandler:^{
        [weakTableView.pullToRefreshView setTitle:@"Kéo để cập nhật" forState:SVPullToRefreshStateAll];
        [weakTableView.pullToRefreshView setTitle:@"Thả ra để cập nhật" forState:SVPullToRefreshStateTriggered];
        [weakTableView.pullToRefreshView setTitle:@"Đang cập nhật" forState:SVPullToRefreshStateLoading];
    //load data
    }];

@LawrenceHan
Copy link

@ioskunal
Copy link

ioskunal commented Sep 7, 2017

@anhhtbk instead of setting the title in the block , try setting it outside the block and after adding the Pull To Refresh to the tableview. This will solve your problem.

```[_tableView addPullToRefreshWithActionHandler:^{
//load data
}];
    [weakTableView.pullToRefreshView setTitle:@"Kéo để cập nhật" forState:SVPullToRefreshStateAll];
    [weakTableView.pullToRefreshView setTitle:@"Thả ra để cập nhật" forState:SVPullToRefreshStateTriggered];
    [weakTableView.pullToRefreshView setTitle:@"Đang cập nhật" forState:SVPullToRefreshStateLoading];```

It does not happen for the first time because the value for the title is set when block is called, and block would be called after first time. Try this thing it will work ;)

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