mirror of
https://github.com/zhigang1992/FunctionalReactivePixels.git
synced 2026-01-12 22:47:31 +08:00
Added vote button.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user