Discussion Forums  >  Self Hosted Control Panels

Replies: 3    Views: 48

andydahl
Aspiring developer
Profile
Posts: 209
Reg: Jul 20, 2011
Villa Grove
4,540
08/05/12 12:51 PM (13 years ago)

Add top margin to Location screen?

Implementing JC Evans awesome tutorial on adding a custom nav bar image ( http://www.buzztouch.com/forum/thread.php?tid=C1FEA6BE49701EE749955DD&currentPage=1 ) and I've run into a slight issue with my location screen (BT_screen_settingsLocation). My custom nav bar image covers the first row of the screen ("Prevent Location Report"). Does anyone know how I would add some margin or padding to the screen, so it pushes the menu items down? I would like to place about 65px of margin before the first menu item starts. Any help would be appreciated! Regards, Andy
 
SkullyFox
Apple Fan
Profile
Posts: 169
Reg: Jul 15, 2012
Armidale
12,190
like
08/05/12 04:12 PM (13 years ago)
I did something like this recently for menu items, you might be able to taylor it to suit your needs. The story for me was i wanted to take the default menu margins and modify them to make the menu whatever size/shape i liked, i did this by, under the screens .m file i picked (screemMenuSimple, screenMenuAdvanced) - in your case it will be your location screen .h file, i ''//' the following line under the "//build the table that holds the menu items" area; "self.myTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;" and under that (before [self.myTableView setDataSource:self]; & [self.myTableView setDelegate:self];) i entered the line "[self.myTableView setFrame: CGRectMake (10, 10, 150, 480)];" So it should look something like this: //build the table that holds the menu items. self.myTableView = [BT_viewUtilities getTableViewForScreen:[self screenData]]; //self.myTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self.myTableView setFrame: CGRectMake (10, 10, 150, 480)]; [self.myTableView setDataSource:self]; [self.myTableView setDelegate:self]; In your case however (if it works) - you would set the y margin to '0' (so the screen went all the way to the sides - and set the x margin to 65, and make the screen length 415 (480 - 65), making it look something like this; [self.yourclassname setFrame: CGRectMake (0, 65, 340, 415)]; you will have to taylor it to your needs, if it works at all for a screen item instead of a menu item as i had applied it. good luck! keep us posted on your progress. Cheers, Dave
 
ATRAIN53
Code is Art
Profile
Posts: 1755
Reg: Nov 17, 2011
Chicago
26,450
like
08/06/12 07:28 AM (13 years ago)
I love that new mod from JC. I was looking at a Custom Nav Bar tutorial that subclasses the Nav Bar. This way you can reference it per screen. His method is an all or nothing approach. It works great but if you don't want it on a particular screen or run into a situation like this..... However I think you can easily lower the menu list 'margin' in the BT control panel. I don't even thin you need to get into code here. I know the BTM Simple Advanced menu has this margin setting, it's how I line up my menu below the header image. Maybe use that screen and set the margin sans image?
 
andydahl
Aspiring developer
Profile
Posts: 209
Reg: Jul 20, 2011
Villa Grove
4,540
like
08/08/12 10:14 AM (13 years ago)
Thanks for your help with this. Unfortunately, I just can't seem to get some extra space on my app. Here's a screenshot to show what I'm trying to accomplish: https://www.dropbox.com/s/n5dqqhbcb5at1vk/header-issue.png I just need to move the "Prevent Location Reports" down below the custom navbar. Any help with editing the BT_screen_settingsLocation.m file in BT 2.0 Self-Hosted would be appreciated! I'd happily buy someone a beer or Starbucks for some help! Regards, Andy
 

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.