Added vote button.

This commit is contained in:
Ash Furrow
2013-10-20 15:43:39 -04:00
parent 8570f6dd50
commit 8ab53a8620

View File

@@ -51,7 +51,7 @@
// Configure self's view
self.view.backgroundColor = [UIColor blackColor];
// Configure subviewe
// Configure subviews
UILabel *ratingLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 64, CGRectGetWidth(self.view.bounds), 100)];
RAC(ratingLabel, text) = [RACObserve(self.photoModel, rating) map:^id(id value) {
return [NSString stringWithFormat:@"%0.2f", [value floatValue]];
@@ -74,5 +74,11 @@
photographerNameLabel.textColor = [UIColor colorWithWhite:0.5f alpha:1.0f];
photographerNameLabel.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:photographerNameLabel];
UIButton *voteButton = [UIButton buttonWithType:UIButtonTypeCustom];
voteButton.frame = CGRectMake(20, CGRectGetHeight(self.view.bounds) - 44 - 20, CGRectGetWidth(self.view.bounds) - 40, 44);
[voteButton setTitle:@"Vote" forState:UIControlStateNormal];
voteButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self.view addSubview:voteButton];
}
@end