Skip to content

Commit

Permalink
Improved layout of today widget
Browse files Browse the repository at this point in the history
  • Loading branch information
D-32 committed Sep 29, 2014
1 parent 79b791b commit 7b0f2c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions BitStoreToday/TodayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ - (void)viewWillAppear:(BOOL)animated {
[sendButton setTintColor:buttonTintColor];
[sendButton setSelectedTintColor:buttonSelectedColor];
CGSize sendSize = [sendTitle sizeWithAttributes:@{NSFontAttributeName:sendButton.titleLabel.font}];
sendButton.frame = CGRectMake(self.view.bounds.size.width - sendSize.width - 30, 7, sendSize.width, 50);
[sendButton addTarget:self action:@selector(actionSend:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:sendButton];

Expand All @@ -60,9 +59,14 @@ - (void)viewWillAppear:(BOOL)animated {
[receiveButton setTintColor:buttonTintColor];
[receiveButton setSelectedTintColor:buttonSelectedColor];
CGSize receiveSize = [receiveTitle sizeWithAttributes:@{NSFontAttributeName:receiveButton.titleLabel.font}];
receiveButton.frame = CGRectMake(self.view.bounds.size.width - receiveSize.width - sendSize.width - 60, 12, receiveSize.width, 50);
[receiveButton addTarget:self action:@selector(actionReceive:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:receiveButton];


CGFloat width = sendSize.width + receiveSize.width;
CGFloat padding = (180 - width) / 3;
sendButton.frame = CGRectMake(self.view.bounds.size.width - sendSize.width - padding, 7, sendSize.width, 50);
receiveButton.frame = CGRectMake(self.view.bounds.size.width - receiveSize.width - sendSize.width - padding * 2, 12, receiveSize.width, 50);
}

- (void)actionSend:(id)sender {
Expand Down

0 comments on commit 7b0f2c8

Please sign in to comment.