Created
March 13, 2014 20:12
-
-
Save MichMich/9535985 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
self.view.backgroundColor = [UIColor blackColor]; | |
//The following line creates a shimmer timing problem. | |
FBShimmeringView *shimmerView = [[FBShimmeringView alloc]init]; | |
//The following line works, but is unneccecery for common autolayout practices. | |
//FBShimmeringView *shimmerView = [[FBShimmeringView alloc]initWithFrame:self.view.bounds]; | |
shimmerView.translatesAutoresizingMaskIntoConstraints = NO; | |
[self.view addSubview:shimmerView]; | |
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[shimmerView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(shimmerView)]]; | |
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[shimmerView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(shimmerView)]]; | |
UILabel *textLabel = [UILabel new]; | |
textLabel.text = @"Shimmer Test"; | |
textLabel.textColor = [UIColor whiteColor]; | |
textLabel.textAlignment = NSTextAlignmentCenter; | |
shimmerView.contentView = textLabel; | |
shimmerView.shimmering = YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment