Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 161

Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
09/21/13 10:42 AM (12 years ago)

iOS7 and Menu With Image Plugin

Just wanted to make it aware that the Menu With Image plugin is putting a 50-70 pixel padding (or blank area) between the bottom of the header image and the beginning of the menu items. Not sure if this is something that the plugin author needs to address, or if it will be fixed with the release of BT 3.0 Other issues with this plugin and iOS 7, which I believe will fix themselves when BT 3.0 come out, since they are styling issues, are that the menu items background color default to white, regardless of what color you tell it in BT. Even "clear" doesn't work. The row description text also goes a little too far to the left and gets cut off a bit behind your icon. Like I said, I'm sure these will fix themselves with BT 3.0, but just wanted to put it out there so that Chris and/or the plugin authors would know what to look for when applying changes to the code.
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
09/21/13 11:48 AM (12 years ago)
See my fix here for the row description issue: https://www.buzztouch.com/forum/thread.php?tid=CB78661C44F4CD920BCEBB6&currentPage=1 That should solve one part.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/22/13 06:15 AM (12 years ago)
Perfect thanks! Can't find a fix for the vertical padding (blank space) issue below the header, and the two or three fixes for the color of the nav bars and rows that I have found don't work for me. Using the newest Xcode 5 (public release) with iOS7 and BT 2.19
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/22/13 07:14 AM (12 years ago)
Just tried changing line 109 to the specified alternative... didn't work for me. Row description text is still in the same position, being cut off on the left side by the icon. Did a "clean" in xcode first to make sure the -8 to -2 change was seen by xcode, didn't visually change anything :(
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/22/13 11:40 PM (12 years ago)
Here's another fix for the description text: In the cell class (will depend on which menu plugin you're using), look toward the top for the "initWithStyle" method. If you scroll through that method, you should find the following code for the description label: //textView for description. no padding! descriptionLabel = [[UITextView alloc] init]; [descriptionLabel setClipsToBounds:YES]; [descriptionLabel setBackgroundColor:[UIColor clearColor]]; [descriptionLabel setEditable:FALSE]; [descriptionLabel setUserInteractionEnabled:FALSE]; [descriptionLabel setShowsVerticalScrollIndicator:FALSE]; [descriptionLabel setShowsHorizontalScrollIndicator:FALSE]; [descriptionLabel setContentInset:UIEdgeInsetsMake(-8,-8,0,0)]; descriptionLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; [self.contentView addSubview:descriptionLabel]; Change that second line of code to: [descriptionLabel setClipsToBounds:NO];
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/22/13 11:51 PM (12 years ago)
Here's a fix for the padding on the table: In the viewDidLoad method, after the myTableView has been alloc'd, insert this code: self.myTableView.contentInset = UIEdgeInsetsMake(-36, 0, 0, 0);
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/22/13 11:52 PM (12 years ago)
(that was a bit of a hack, due to changes in how iOS7 believes tables with rounded corners should be presented. (Note, if you keep the table standard, not rounded, the issue isn't there). See: http://stackoverflow.com/questions/18880341/why-is-there-extra-padding-at-the-top-of-my-uitableview-with-style-uitableviewst
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/22/13 11:57 PM (12 years ago)
It looks like the issue with the rounded corners and white background is also problematic in iOS7 for the same reason - basically Apple doesn't want us using rounded corners for tables anymore.
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/23/13 06:33 AM (12 years ago)
Thanks Chris, trying them now. Changing to square corners instead of round corners did fix the vertical padding issues... still has white background though (even "clear" doesn't work). Trying the other fixes now. Thanks again. Will these be behind the scene fixes in BT 3.0?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/23/13 07:18 AM (12 years ago)
The description fix also worked. It was strange because I changed to square corners first, which fixed the vertical padding. I then applied the description fix, which worked but the vertical padding was back. I then went into my BT panel for that screen and resaved my JSON data, and it magically fixed the vertical padding again. Strange behavior, but hey, it works, lol. Still can't make the rows clear though :( Any ideas on that?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/23/13 07:51 AM (12 years ago)
In the cellForRowAtIndexPath method, add this line right before the "return cell" line at the end: [cell setBackgroundColor:[UIColor clearColor]];
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/23/13 07:55 AM (12 years ago)
looks like you can keep the rounded look using that also
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/23/13 08:34 AM (12 years ago)
Awesome work Chris, those solutions worked perfectly. Had to install your suggested "hack" above this time to get the vertical spacing to go away after choosing rounded corners this time after applying the clear row code. Last thing to get my app back to the way it was before iOS 7... do you have an easy fix to make the top bar and bottom tabbed bar menu black again? Since iOS7, they have been white, and my icons were made to look best against a black background. I tried the other various fixes for this, but none worked for me. Thanks. Just curious, will these all be fixed automatically in BT 3.0? If it's only about a week away, I'd rather just let BT 3.0 take care of the issues instead of customizing the code, since I'd have to do it each time I redownload the code. Still working on this app, and there will probably b e more paid plugins that I use as i get more ideas, so it would require downloading and editing the code each time. If BT 3.0 is coming soon, and will take care of all these styling issues, I'll just let them go for now and concentrate on adding the data and screens contained in my app. :)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/23/13 09:04 AM (12 years ago)
Not sure what the status is on the new iOS core. David Book would be the one to answer that. For the navBar, check out this: http://stackoverflow.com/questions/18929864/how-do-i-change-the-navigation-bar-color-in-ios-7
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
09/23/13 09:31 AM (12 years ago)
Thanks. I was able to change the navigation bar, but the bottom (tabbed) bar remains only tinted that color, can't figure out how to make it solid color and not tinted. In BT_ViewController.m, in the ViewDidLoad, just below [self becomeFirstResponder]; I added: self.navigationController.navigationBar.tintColor = [UIColor redColor]; //change the nav bar color self.navigationController.view.backgroundColor = [UIColor redColor]; //change the background color self.navigationController.navigationBar.translucent = NO; (obviously change "redColor" to whatever color you want) I still can't figure out the solid color of the tab bar at the bottom though. The above code also doesn't work on some screens for some reason, but I think I need to put the above code in all "viewdidload" events on all views.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
09/26/13 10:08 AM (12 years ago)
Thanks for this.
 

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.