Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- NSLog(@"%f", [[self view] bounds].size.width);
- }
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- NSLog(@"%f", [[self view] bounds].size.width);
- }
- - (void)viewDidAppear:(BOOL)animated
- {
- [super viewDidAppear:animated];
- NSLog(@"%f", [[self view] bounds].size.width);
- }
- 2015-02-11 14:48:03.274 MyApp[2948:86285] 320.000000
- 2015-02-11 14:48:03.274 MyApp[2948:86285] 320.000000
- 2015-02-11 14:48:03.783 MyApp[2948:86285] 320.000000
- NSLog(@"%f", [[UIScreen mainScreen] bounds].size.width);
- NSLog(@"%f", [[self view] bounds].size.width);
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view from its nib.
- NSLog(@"%f",[[self view] bounds].size.width);
- }
- -(void) viewWillAppear:(BOOL)animated{
- NSLog(@"%f",[[self view] bounds].size.width);
- [testIndicator startAnimatingInView:self.view];
- }
- 2016-02-17 19:00:47.519 xxxxx[16107:504629] 320.000000
- 2016-02-17 19:00:47.521 xxxxx[16107:504629] 414.000000
- - (void)viewDidLoad {
- NSLog(@"screens = %@", [UIScreen screens]);
- NSLog(@"self.frame= %@", NSStringFromCGRect([[UIScreen mainScreen] bounds]));
- NSLog(@"self.view.frame= %@", NSStringFromCGRect(self.view.frame));
- }
- 2015-02-11 12:45:19.116 Test[1558:87057] screens = (
- "<UIScreen: 0x7ff0b970bcc0; bounds = {{0, 0}, {375, 667}}; mode = <UIScreenMode: 0x7ff0b961b500; size = 750.000000 x 1334.000000>>"
- )
- 2015-02-11 12:45:19.117 Test[1558:87057] self.frame= {{0, 0}, {375, 667}}
- 2015-02-11 12:45:19.117 Test[1558:87057] self.view.frame= {{0, 0}, {375, 667}}
- -(void)viewDidLoad
- {
- [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(getMyFrame) userInfo:nil repeats:NO];
- [super viewDidLoad];
- }
- -(void)getMyFrame
- {
- NSLog(@"%f", [[self view] bounds].size.width);
- }
- override func viewWillLayoutSubviews() {
- print("view Size: (view.bounds.width)")
- }
- NSLog(@"Width: %f Height: %f"
- ,[[UIScreen mainScreen] bounds].size.width
- ,[[UIScreen mainScreen] bounds].size.height);
Add Comment
Please, Sign In to add comment