0

I got this problem on two different devices on calling this method

- (void)drawRect:(CGRect)rect {

    NSLog(@"%@", NSStringFromCGRect(rect));
    NSLog(@"F: %@", NSStringFromCGRect(self.frame));
    NSLog(@"B: %@", NSStringFromCGRect(self.bounds));

    [super drawRect:rect];
}

On iOS8 output is:

{{-1.5, -3}, {74, 22.5}}
F: {{235, 63.5}, {70, 15}}
B: {{0, 0}, {70, 15}}

but iOS7 output is:

{{0, 0}, {70, 15}}
F: {{235, 63.5}, {70, 15}}
B: {{0, 0}, {70, 15}}

And This label's constraints are: enter image description here

BotherBox
  • 21
  • 3
  • See here: [iOS 7 vs iOS 8 Constraints differ in sizes](http://stackoverflow.com/questions/27695758/ios-7-vs-ios-8-constraints-differ-in-sizes) – Roy K Dec 11 '15 at 09:15
  • @RoyK thanks for the answer. The label's constraints related to it's super view just the `Trailing Space`, The label's `Width` and `Height` setted explicit – BotherBox Dec 11 '15 at 10:27

1 Answers1

0

it might be because of status bar. if you want to hide status bar then this or viceversa

<key>UIStatusBarHidden</key>
<true/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
vaibby
  • 1,255
  • 1
  • 9
  • 23