Skip to content
Browse files

made it such that the header text color and arrow image can be changed

  • Loading branch information...
1 parent 045ef31 commit f4779a2bd6eec6a87e8fc3edf492e3a987c4b9e1 @achainan achainan committed Apr 6, 2011
View
2 EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.h
@@ -49,6 +49,8 @@ typedef enum{
@property(nonatomic,assign) id <EGORefreshTableHeaderDelegate> delegate;
+- (id)initWithFrame:(CGRect)frame arrowImageName:(NSString *)arrow textColor:(UIColor *)textColor;
+
- (void)refreshLastUpdatedDate;
- (void)egoRefreshScrollViewDidScroll:(UIScrollView *)scrollView;
- (void)egoRefreshScrollViewDidEndDragging:(UIScrollView *)scrollView;
View
11 EGOTableViewPullRefresh/Classes/View/EGORefreshTableHeaderView.m
@@ -40,7 +40,7 @@ @implementation EGORefreshTableHeaderView
@synthesize delegate=_delegate;
-- (id)initWithFrame:(CGRect)frame {
+- (id)initWithFrame:(CGRect)frame arrowImageName:(NSString *)arrow textColor:(UIColor *)textColor {
if (self = [super initWithFrame:frame]) {
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
@@ -49,7 +49,7 @@ - (id)initWithFrame:(CGRect)frame {
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, frame.size.height - 30.0f, self.frame.size.width, 20.0f)];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.font = [UIFont systemFontOfSize:12.0f];
- label.textColor = TEXT_COLOR;
+ label.textColor = textColor;
label.shadowColor = [UIColor colorWithWhite:0.9f alpha:1.0f];
label.shadowOffset = CGSizeMake(0.0f, 1.0f);
label.backgroundColor = [UIColor clearColor];
@@ -61,7 +61,7 @@ - (id)initWithFrame:(CGRect)frame {
label = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, frame.size.height - 48.0f, self.frame.size.width, 20.0f)];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.font = [UIFont boldSystemFontOfSize:13.0f];
- label.textColor = TEXT_COLOR;
+ label.textColor = textColor;
label.shadowColor = [UIColor colorWithWhite:0.9f alpha:1.0f];
label.shadowOffset = CGSizeMake(0.0f, 1.0f);
label.backgroundColor = [UIColor clearColor];
@@ -73,7 +73,7 @@ - (id)initWithFrame:(CGRect)frame {
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(25.0f, frame.size.height - 65.0f, 30.0f, 55.0f);
layer.contentsGravity = kCAGravityResizeAspect;
- layer.contents = (id)[UIImage imageNamed:@"blueArrow.png"].CGImage;
+ layer.contents = (id)[UIImage imageNamed:arrow].CGImage;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
@@ -99,6 +99,9 @@ - (id)initWithFrame:(CGRect)frame {
}
+- (id)initWithFrame:(CGRect)frame {
+ return [self initWithFrame:frame arrowImageName:@"blueArrow.png" textColor:TEXT_COLOR];
+}
#pragma mark -
#pragma mark Setters

0 comments on commit f4779a2

Please sign in to comment.
Something went wrong with that request. Please try again.