-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSAlwaysOnTopHeader.m
More file actions
33 lines (25 loc) · 731 Bytes
/
CSAlwaysOnTopHeader.m
File metadata and controls
33 lines (25 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// CSAlwaysOnTopHeader.m
// CSStickyHeaderFlowLayoutDemo
//
// Created by James Tang on 6/4/14.
// Copyright (c) 2014 Jamz Tang. All rights reserved.
//
#import "CSAlwaysOnTopHeader.h"
#import "CSStickyHeaderFlowLayoutAttributes.h"
@implementation CSAlwaysOnTopHeader
- (void)applyLayoutAttributes:(CSStickyHeaderFlowLayoutAttributes *)layoutAttributes {
[UIView beginAnimations:@"" context:nil];
if (layoutAttributes.progressiveness <= 0.58) {
self.titleLabel.alpha = 1;
} else {
self.titleLabel.alpha = 0;
}
if (layoutAttributes.progressiveness >= 1) {
self.searchBar.alpha = 1;
} else {
self.searchBar.alpha = 0;
}
[UIView commitAnimations];
}
@end