Reputation: 2053
I am using Cocoanetic's implementation of EGOTableViewPullRefresh
.
It's a cinch to implement. Love it:
The only problem I'm having is with rotation. When the view rotates, the refresh header doesn't adjust for landscape mode. It sits left aligned, 320.0f units wide.
I have tried everything I can think of to adjust this properly. I set it as a property in PullToRefreshTableViewController
and tried to set the frame the same way it is done in init. This failed. I tried to do it in this same controller in viewWillAppear
. Failed.
Beyond this, I tried about 6 other methods not worth detailing. The problem seems to be that I'm using the wrong bounds, even though I'm making them relative to the view.
Nothing I do replicates what is seemingly easy in viewDidLoad
:
refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:
CGRectMake(0.0f, 0.0f - self.view.bounds.size.height,
320.0f, self.view.bounds.size.height)];
It seems all I really need to do is increase the width. I tried something along the lines of this:
refreshHeaderView.frame = CGRectMake(refreshHeaderView.frame.origin.x, refreshHeaderView.frame.origin.y, 480.0f, refreshHeaderView.frame.size.height);
No luck.
The link at the top has the full, unmodified source code for what I'm using.
Upvotes: 0
Views: 339
Reputation: 243146
What about just setting the UIView.autoresizingMask
to UIViewAutoresizingFlexibleWidth
?
Upvotes: 4