Easy iOS7 overlapping fix


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. 1) In the viewWillAppear section, find the "//setup navigation bar and background" code. Add this below it:
  2.  
  3. //setup navigation bar and background
  4. [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]];
  5.  
  6. //set backgroundView image/color
  7. NSString *bgColor = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundColor" defaultValue:@"clear"];
  8. NSString *bgImage = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundImageNameSmallDevice" defaultValue:@""];
  9. if ([appDelegate.rootApp.rootDevice isIPad]) {
  10. bgImage = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundImageNameLargeDevice" defaultValue:@""];
  11. }
  12.  
  13. if ([bgColor length]>0) {
  14. UIColor *bgColorObj = [BT_color getColorFromHexString:bgColor];
  15. self.view.backgroundColor = bgColorObj;
  16. }
  17. if ([bgImage length]>0) {
  18. UIImageView *bgImageView = [UIImageView new];
  19. bgImageView.frame = self.view.frame;
  20. [bgImageView setContentMode:UIViewContentModeScaleToFill];
  21. if ([BT_fileManager doesFileExistInBundle:bgImage]) {
  22. bgImageView.image = [UIImage imageNamed:bgImage];
  23. }
  24. else if ([BT_fileManager doesLocalFileExist:bgImage]) {
  25. bgImageView.image = [BT_fileManager getImageFromFile:bgImage];
  26. }
  27. [self.view addSubview:bgImageView];
  28. [self.view sendSubviewToBack:bgImageView];
  29. }
  30.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.