Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 18    Views: 217

Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
12/20/13 11:07 AM (10 years ago)

A few context menu tweaks

I personally found the context menu a little small for my big fingers to select rows on a device (simulator was fine, lol). So here are a few quick tweaks to edit the size of the context menu rows and fonts... Row Height: Find line #59 in BT_contextMenu.m Change to: int tableRowHeight = 40; (or any height you want). Font Size Find line #214 in BT_contextMenu.m Change to: UIFont *rowFont = [UIFont fontWithName: @"Helvetica" size: 18.0]; (or change the 18.0 to a size that works for you. Note: You can also change the font in the above tweak to better fit your app. Use a font family name from the iosfonts.com site. BONUS: Same file, line 64: [menuTable setBackgroundColor:[UIColor whiteColor]]; Here you can change the background color of the context menu (but not the cells) so... Around line 217 add: //set cell background color cell.backgroundColor = [UIColor whiteColor]; And change to whatever UIColor you wish In the future, we plan on allowing a lot more customization in the control panel, but for now, I wanted to make sure you could all find your way around the code and make some easy changes.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
12/20/13 11:46 AM (10 years ago)
What is the context menu?
 
Joe Sprott
Code is Art
Profile
Posts: 414
Reg: Aug 20, 2011
Melbourne, FL
10,290
like
12/20/13 01:05 PM (10 years ago)
it is an additional menu which is in the control panel. It allows additional navigation for the app user. David added it in Android 3.0 and now ios 3.0. It is called "menu" in the control panel and is visible on the bottom right or top right of apps. If a users taps it they will see all your additional navigation without returning to the main menu screen Joe Sprott Bodacious Media
 
Grateful
buzztouch Evangelist
Profile
Posts: 69
Reg: Dec 03, 2012
Long Beach
5,340
like
12/27/13 03:55 AM (10 years ago)
Hi, Is there a way to add icons to the contextual menu?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
12/27/13 07:33 AM (10 years ago)
Currently, not from the control panel. But certainly from the source code. Expect some additional features to be added to the context menu in the future. But no scheduled release date of these new features yet. -Chris
 
Grateful
buzztouch Evangelist
Profile
Posts: 69
Reg: Dec 03, 2012
Long Beach
5,340
like
12/27/13 05:34 PM (10 years ago)
Thanks for the response. I was wondering if you knew how to add the icons in within the code, similar to your customization instructions above?
 
Patrickmotox
Aspiring developer
Profile
Posts: 89
Reg: Dec 10, 2013
Cameron Park, C...
7,090
like
02/05/14 03:28 PM (10 years ago)
nice.....
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/07/14 09:51 AM (10 years ago)
Thanks Stobe! The height and text size are a nice improvement. A few iOS7 BT3 questions: 1) Where would the overall height be adjusted (a multiple of rows...) Looks a little strange with lots of white below when you only have a few rows. 2) How could we change the Transition Type to something other then Default for the LoadScreen? So far I have added a Login Screen, Allow GPS and a Parse Screen to the Context Menu, but the dreaded slide transition happens with all three ;)
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/07/14 12:09 PM (10 years ago)
Here's a partial answer for #1. I'll look for #2 also... 1) In your app_Delegate.m file, look at line #599. It should look like this: [contextMenu.menuTable setFrame:CGRectMake(0, tableTop, (w / 2), 300)]; Change the "300" at the end to any other number to adjust the height of the view. If you have your menu finished, and you know how many rows you have, you could multiply that by your rowHeight (remembering to add a row for "cancel"). You might need to add an extra pixel or two to get the bottom row to fully show. Example, if you had a context menu with 3 menu items in it, you could make your view height: 4 x 30 + 1 = 121 (3 rows, plus cancel = 4 rows. Times 30 pixels per row. Plus 1). I know this isn't perfect. And if definitely wont work if you're planning on dynamically changing the number of menu items after you compile. The better way would be to have the code count the number of rows in your menu, and do the math for you. Maybe something to add down the road? Hope this makes sense, and helps.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/07/14 12:38 PM (10 years ago)
Here's my guess for #2, but I don't have a solution at this point. Another feature request to add to the list... Looks like the method to handle the row select in the contextMenu class is just a simple loadScreen method. If you used the handleTapToLoadScreen method that's built into the viewController, you could pass it a "transitionType" Again, something you could "hard code" for now, but would require some work to add that option to the control panel. -Chris
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/07/14 01:16 PM (10 years ago)
#1 worked Great - Thanks! (will try #2 tomorrow)
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/07/14 02:05 PM (10 years ago)
Glad to help.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/07/14 02:10 PM (10 years ago)
BTW, I think I stopped (relatively) near your area not too long ago. We stopped in Dunn and got a burger at some place that advertised all over the Interstate. Goo stuff. You'll have to try to make it up to Virginia if we have another meetup. -Chris
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/07/14 05:26 PM (10 years ago)
Dunn is about 15-20 mins East right off of I-95. Would be great to head up for a meetup if timing works this Summer. Not sure how to pass a "transitionType". Any docs on the site? //load the next screen [self handleTapToLoadScreen:screenObjectToLoad theMenuItemData:tmpMenuItem];
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
02/07/14 05:38 PM (10 years ago)
you could try adding a default transition type to the Theme's menu. In the advanced JSON section you could add "transitionType":"fade" (or any of the normal animation styles). I haven't tested that, so I'm not real sure if it would work. We might need to add a line to the contextMenu.m to look at the theme. On the bright side, we're exploring a lot of cool things to add to the context menu, but I just can't promise any timeline yet. -Chris
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
02/08/14 08:23 AM (10 years ago)
Tried adding to Theme and Menu-with-Image but no change. Will try starting a new topic to see if anyone else has had success with this.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
03/11/14 07:07 PM (10 years ago)
random thought... Stobe- Whenever the Context Menu gets an upgrade- a small change might be to set the default Context Menu width to a set value(contextMenuWidth (default 160)) rather than w/2. Landscape would require a little tweak for the position based on the screen width -contextMenuWidth.
 
JimmySaver
Aspiring developer
Profile
Posts: 187
Reg: Apr 09, 2012
location unknow...
5,870
like
04/19/14 01:28 PM (10 years ago)
Howdy all. Before I clutter up the forums, did anyone get anywhere with adding icons (custom, ideally) to the context menu? I'd be happy to have them programatically done, even if they were fixed (as the menu wouldn't update in this particular project without a resubmission). Grateful of any assistance - thanks in advance.
 
Jan88
Aspiring developer
Profile
Posts: 9
Reg: May 17, 2014
Bangkok
3,240
like
05/25/14 04:46 AM (9 years ago)
Hello everyone, working on my first iOS App. Everything is going smooth, but I can't seem to find the attribute of the context menu's icon color. Does anybody has an idea where I can change that. I was able to change the color of the title and back button within Xcode, so this is the last missing piece :) Thanks to everyone already in advance. - Jan
 

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.