-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathLayoutAnimationsViewController.m
More file actions
37 lines (31 loc) · 980 Bytes
/
LayoutAnimationsViewController.m
File metadata and controls
37 lines (31 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// LayoutAnimationsViewController.m
// iDroidLayout
//
// Created by Tom Quist on 22.07.12.
// Copyright (c) 2012 Tom Quist. All rights reserved.
//
#import <QuartzCore/QuartzCore.h>
#import "LayoutAnimationsViewController.h"
#import "iDroidLayout.h"
@implementation LayoutAnimationsViewController
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *otherLabel = (UILabel *)[self.view findViewById:@"otherText"];
otherLabel.contentMode = UIViewContentModeScaleToFill;
}
- (void)didPressButton {
UILabel *textLabel = (UILabel *)[self.view findViewById:@"text"];
if ([textLabel.text isEqualToString:@"Short text"]) {
textLabel.text = @"Very long long text";
} else {
textLabel.text = @"Short text";
}
[UIView animateWithDuration:0.2 animations:^{
[self.view layoutIfNeeded];
}];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return TRUE;
}
@end