Guest User

Untitled

a guest
Oct 19th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. - (void)viewDidLoad
  2. {
  3. [super viewDidLoad];
  4. NSLog(@"%f", [[self view] bounds].size.width);
  5. }
  6. - (void)viewWillAppear:(BOOL)animated
  7. {
  8. [super viewWillAppear:animated];
  9. NSLog(@"%f", [[self view] bounds].size.width);
  10. }
  11. - (void)viewDidAppear:(BOOL)animated
  12. {
  13. [super viewDidAppear:animated];
  14. NSLog(@"%f", [[self view] bounds].size.width);
  15. }
  16.  
  17. 2015-02-11 14:48:03.274 MyApp[2948:86285] 320.000000
  18. 2015-02-11 14:48:03.274 MyApp[2948:86285] 320.000000
  19. 2015-02-11 14:48:03.783 MyApp[2948:86285] 320.000000
  20.  
  21. NSLog(@"%f", [[UIScreen mainScreen] bounds].size.width);
  22.  
  23. NSLog(@"%f", [[self view] bounds].size.width);
  24.  
  25. - (void)viewDidLoad {
  26. [super viewDidLoad];
  27. // Do any additional setup after loading the view from its nib.
  28. NSLog(@"%f",[[self view] bounds].size.width);
  29.  
  30. }
  31. -(void) viewWillAppear:(BOOL)animated{
  32. NSLog(@"%f",[[self view] bounds].size.width);
  33. [testIndicator startAnimatingInView:self.view];
  34. }
  35.  
  36. 2016-02-17 19:00:47.519 xxxxx[16107:504629] 320.000000
  37. 2016-02-17 19:00:47.521 xxxxx[16107:504629] 414.000000
  38.  
  39. - (void)viewDidLoad {
  40. NSLog(@"screens = %@", [UIScreen screens]);
  41. NSLog(@"self.frame= %@", NSStringFromCGRect([[UIScreen mainScreen] bounds]));
  42. NSLog(@"self.view.frame= %@", NSStringFromCGRect(self.view.frame));
  43. }
  44.  
  45. 2015-02-11 12:45:19.116 Test[1558:87057] screens = (
  46. "<UIScreen: 0x7ff0b970bcc0; bounds = {{0, 0}, {375, 667}}; mode = <UIScreenMode: 0x7ff0b961b500; size = 750.000000 x 1334.000000>>"
  47. )
  48. 2015-02-11 12:45:19.117 Test[1558:87057] self.frame= {{0, 0}, {375, 667}}
  49. 2015-02-11 12:45:19.117 Test[1558:87057] self.view.frame= {{0, 0}, {375, 667}}
  50.  
  51. -(void)viewDidLoad
  52. {
  53. [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(getMyFrame) userInfo:nil repeats:NO];
  54. [super viewDidLoad];
  55. }
  56. -(void)getMyFrame
  57. {
  58. NSLog(@"%f", [[self view] bounds].size.width);
  59. }
  60.  
  61. override func viewWillLayoutSubviews() {
  62. print("view Size: (view.bounds.width)")
  63. }
  64.  
  65. NSLog(@"Width: %f Height: %f"
  66. ,[[UIScreen mainScreen] bounds].size.width
  67. ,[[UIScreen mainScreen] bounds].size.height);
Add Comment
Please, Sign In to add comment