/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
1) In the viewWillAppear section, find the "//setup navigation bar and background" code. Add this below it: //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]]; //set backgroundView image/color NSString *bgColor = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundColor" defaultValue:@"clear"]; NSString *bgImage = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundImageNameSmallDevice" defaultValue:@""]; if ([appDelegate.rootApp.rootDevice isIPad]) { bgImage = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"backgroundImageNameLargeDevice" defaultValue:@""]; } if ([bgColor length]>0) { UIColor *bgColorObj = [BT_color getColorFromHexString:bgColor]; self.view.backgroundColor = bgColorObj; } if ([bgImage length]>0) { UIImageView *bgImageView = [UIImageView new]; bgImageView.frame = self.view.frame; [bgImageView setContentMode:UIViewContentModeScaleToFill]; if ([BT_fileManager doesFileExistInBundle:bgImage]) { bgImageView.image = [UIImage imageNamed:bgImage]; } else if ([BT_fileManager doesLocalFileExist:bgImage]) { bgImageView.image = [BT_fileManager getImageFromFile:bgImage]; } [self.view addSubview:bgImageView]; [self.view sendSubviewToBack:bgImageView]; }