From 8ab53a8620b834c055bec2b0230bbf283d8284d7 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Sun, 20 Oct 2013 15:43:39 -0400 Subject: [PATCH] Added vote button. --- FRP/FRPPhotoDetailViewController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FRP/FRPPhotoDetailViewController.m b/FRP/FRPPhotoDetailViewController.m index c039014..16210ee 100644 --- a/FRP/FRPPhotoDetailViewController.m +++ b/FRP/FRPPhotoDetailViewController.m @@ -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