Discussion Forums  >  iOS / Android Beta Testers

Replies: 8    Views: 307

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
10/08/13 03:20 PM (10 years ago)

iOS7 Overlapping Issue - temporary fix

Here's a temporary fix for the "overlapping" issue many are having with menu screens in iOS7. I say "temporary" because this should be resolved once the new iOS Core 3.0 is released. Please note: this is not for the faint of heart! :) I'll be walking you through the process in the Menu with Image plugin. But the same logic applies in other plugins as well. **THE FOLLOWING WAS EDITED TO MAKE IT SIMPLER** WB_screen_menuImage.m: 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]; } That should be it!
 
BranX26
Apple Fan
Profile
Posts: 58
Reg: Feb 07, 2012
Minnesota
580
like
10/08/13 03:36 PM (10 years ago)
My app says 3.0 in the control panel now. Doesn't this mean its out?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/08/13 03:40 PM (10 years ago)
I haven't heard that it's been released yet. Where do you see it saying "3.0"? When it arrives, it will likely show up on the project download page as a new download option (similar to Android, where you can download the old package or the new 3.0 package).
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/08/13 03:56 PM (10 years ago)
And if you'd like to change the navigation bar color to be the same as your menu row background color, here's the code to stick in the viewWillAppear method: //set navBar color NSString *navBarColor = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"navBarColor" defaultValue:[BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"listRowBackgroundColor" defaultValue:@"clear"]]; if (navBarColor.length>0){ NSArray *ver = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."]; if ([[ver objectAtIndex:0] intValue] >= 7) { self.navigationController.navigationBar.barTintColor = [BT_color getColorFromHexString:navBarColor]; self.navigationController.navigationBar.translucent = NO; }else { self.navigationController.navigationBar.tintColor = [BT_color getColorFromHexString:navBarColor]; } }
 
BranX26
Apple Fan
Profile
Posts: 58
Reg: Feb 07, 2012
Minnesota
580
like
10/08/13 04:16 PM (10 years ago)
On my page that list all of my apps... App Name Here created: 08/02/2013 05:35 PM modified: 10/08/2013 03:51 PM vers: 3.0 views: 556 Yesterday, and every day previous, said vers: 1.0
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/08/13 04:30 PM (10 years ago)
Once again, I make things more complicated than they need to be! I just updated the above code to simplify it.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/08/13 04:31 PM (10 years ago)
@BranX26 - my 2.1.9 control panel still says 1.0 for all my apps. But regardless, I don't believe that corresponds to the iOS version number.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
10/08/13 04:39 PM (10 years ago)
And... it seems if you go from one menu screen to another, then you need the first set of code I provided to make it look right. Here it is for reference: WB_screen_menuImage.h file: 1) Between the curly braces, add: UIView *backgroundView; 2) In the "properties" section, add: @property (nonatomic, retain) UIView *backgroundView; WB_screen_menuImage.m file: 3) In the viewDidLoad method, near the top add: //init background view backgroundView = [UIView new]; backgroundView.frame = self.view.frame; 4) In the viewDidLoad section, look for all the "addSubview" methods and replace like so: old: [self.view addSubview:headerImage]; new: [backgroundView addSubview:headerImage]; old: [self.view addSubview:myTableView]; new: [backgroundView addSubview:myTableView]; 5) In the viewDidLoad section, near the bottom add: //add background view [self.view addSubview:backgroundView]; 6) In the viewWillAppear section, find the "//setup navigation bar and background" code and add the following 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]; backgroundView.backgroundColor = bgColorObj; } if ([bgImage length]>0) { UIImageView *bgImageView = [UIImageView new]; bgImageView.frame = backgroundView.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]; } [backgroundView addSubview:bgImageView]; [backgroundView sendSubviewToBack:bgImageView]; }
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
10/09/13 12:40 AM (10 years ago)
Thanks Chris! You are ahead of the game, as always :) Farcat
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.