Skip to content

Commit

Permalink
Forcefully size the drag refresh view properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
jverkoey committed Feb 18, 2010
1 parent 0edd0ca commit 5d0cd1e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/TTTableHeaderDragRefreshView.m
Expand Up @@ -44,7 +44,9 @@ - (id)initWithFrame:(CGRect)frame {
if(self = [super initWithFrame:frame]) {
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;

_lastUpdatedLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_lastUpdatedLabel = [[UILabel alloc]
initWithFrame:CGRectMake(0.0f, frame.size.height - 30.0f,
frame.size.width, 20.0f)];
_lastUpdatedLabel.autoresizingMask =
UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
_lastUpdatedLabel.font = TTSTYLEVAR(tableRefreshHeaderLastUpdatedFont);
Expand All @@ -55,7 +57,9 @@ - (id)initWithFrame:(CGRect)frame {
_lastUpdatedLabel.textAlignment = UITextAlignmentCenter;
[self addSubview:_lastUpdatedLabel];

_statusLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_statusLabel = [[UILabel alloc]
initWithFrame:CGRectMake(0.0f, frame.size.height - 48.0f,
frame.size.width, 20.0f )];
_statusLabel.autoresizingMask =
UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin;
_statusLabel.font = TTSTYLEVAR(tableRefreshHeaderStatusFont);
Expand All @@ -67,21 +71,21 @@ - (id)initWithFrame:(CGRect)frame {
[self setStatus:TTTableHeaderDragRefreshPullToReload];
[self addSubview:_statusLabel];

_arrowImage = [[UIImageView alloc] initWithFrame:CGRectZero];
_arrowImage = [[UIImageView alloc]
initWithFrame:CGRectMake(25.0f, frame.size.height - 65.0f,
30.0f, 55.0f)];
_arrowImage.contentMode = UIViewContentModeScaleAspectFit;
_arrowImage.image = TTSTYLEVAR(tableRefreshHeaderArrowImage);
[_arrowImage layer].transform = CATransform3DMakeRotation(M_PI, 0.0f, 0.0f, 1.0f);
[_arrowImage sizeToFit];
[self addSubview:_arrowImage];

_activityView = [[UIActivityIndicatorView alloc]
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
_activityView.frame = CGRectMake( 25.0f, frame.size.height - 38.0f, 20.0f, 20.0f );
_activityView.hidesWhenStopped = YES;
[_activityView sizeToFit];
[self addSubview:_activityView];

_isFlipped = NO;

}
return self;
}
Expand Down

0 comments on commit 5d0cd1e

Please sign in to comment.