Status bar overlaps with view in iOS7

Status bar

overlaps with the view How to set up a view under the status bar in iOS7 I use XIB not a storyboard

+2
source share
4 answers

In iOS 7.0, the UI status bar is transparent. To account for changes in the application, as with the status bar style, you can use:

 UIStatusBarStyleDefault

so that the status bar is dark, and for easy use of content

 UIStatusBarStyleLightContent

If the problem is with the background image of the View in the application, where the image extends beyond the status bar. Set the image to nib or programmatically (depending on what suits you) explicitly with the dimensions on the image.

. Apple. https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/TransitionGuide.pdf

+1

.

- (void) viewDidLayoutSubviews {
    CGRect viewBounds = self.view.bounds;
    CGFloat topBarOffset = self.topLayoutGuide.length;
    viewBounds.origin.y = topBarOffset * -1;
    self.view.bounds = viewBounds;
}
+2

 if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;   // iOS 7 specific

-(void)viewDidLoad.

+1

:

plist, :

   Status bar is initially hidden : YES
   View controller-based status bar appearance : NO

iOS 7, . info.plist.

, viewcontroller, viewDidLoad , :

 - (void) imagePickerController:(UIImagePickerController *)picker1 didFinishPickingImage:       (UIImage *)image editingInfo:(NSDictionary *)editingInfo
  {
      [[UIApplication sharedApplication] setStatusBarHidden:YES];

   .
   .
   .
   .
  }
0
source

Source: https://habr.com/ru/post/1536921/


All Articles