Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 9    Views: 114

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
09/16/13 07:40 PM (12 years ago)

Hide Header Image from Menu with Image

Hi guys, I'm trying to hide the Header Image for a specific screen in an app using the Menu with Image plugin. I don't have time to re-do the screens with the Menu with Image advanced plugin, I just need a quick fix for this. I placed the code below in WB_screen_menuImage.m file hoping for it to work with no luck so far. I replaced imageHeight = 150; with if([appDelegate.rootApp getScreenDataByNickname:@"Contacts"]){ imageHeight = 0; } else { imageHeight = 150; } I want to hide the header image for the screen with the specific nickname "Contacts" - no luck. Any help is appreciated! David buzztouchmods.com/market
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
09/16/13 10:16 PM (12 years ago)
David you can add a transparent png image to that contact menu. It is a easy solution.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/16/13 10:50 PM (12 years ago)
Instead, try this: NSString *thisItemNickname = [BT_strings getJsonPropertyValue:screenData.jsonVars nameOfProperty:@"itemNickname" defaultValue:@""]; if ([thisItemNickname isEqualTo:@"Contacts"]) { imageHeight = 0; } else { imageHeight = 150; }
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
09/17/13 01:53 AM (12 years ago)
This works great for iphone and ipad, from line 82 to 101 I replace with: //check to see if iPad or which size iPhone and create different frame sizes if that is the case. cablecar_appDelegate *appDelegate = (cablecar_appDelegate *) [[UIApplication sharedApplication] delegate]; if([appDelegate.rootApp.rootDevice isIPad]){ //imageHeight = [[BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"imageHeightIPad":@"300"] intValue]; imageHeight = 0; imageWidth = 768; tableHeight = 1024 - imageHeight; }else { //imageHeight = [[BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"imageHeight":@"150"] intValue]; imageHeight = 0; imageWidth = 320; if([UIScreen mainScreen].bounds.size.height == 568) { tableHeight = 568 -imageHeight; }else{ tableHeight = 480 -imageHeight; } } Farcat
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
09/17/13 09:03 AM (12 years ago)
@Chris, I get a warning that "Instance method -isEqualTo not found (return type defaults to id)" @Farcat, looks awesome! However where in the code would it single out my "Contacts" screen? Thanks guys, David https://buzztouchmods.com/market
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
09/17/13 10:04 AM (12 years ago)
Sorry David, my bad. I went too fast and didn't read it was for a specific screen (although it is clear on your post.) In this case I would load a transparent .png file 1px high, should be the quickest way (I think) - like @ Mackimack said. Farcat
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
09/17/13 10:06 AM (12 years ago)
@farcat I tried that a long time ago, it still made the space as big as a header regardless of the small 1x1 png file. Does it no longer do that? David https://buzztouchmods.com/market
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/17/13 10:07 AM (12 years ago)
Sorry - that's what I get for responding on my phone! Try isEqualToString
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
09/17/13 10:08 AM (12 years ago)
@Chris that worked perfectly! Thanks so much! David https://buzztouchmods.com/market
 
farcat
buzztouch Evangelist
Profile
Posts: 1008
Reg: Jan 27, 2012
France
13,230
like
09/17/13 10:09 AM (12 years ago)
That's a keeper, thanks @Chris! 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.