Discussion Forums  >  Uncategorized

Replies: 2    Views: 198

basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
12/15/11 05:56 AM (14 years ago)

button menu in iOS

I want to create a button menu that fills the home page with only small gaps between the buttons. To do this, I need to remove the bottom tab bar from the home page. I've set this to hide in the menu's advanced menu properties / navigation bar/status bar section, but it's still there. How can I hide it in this one page? I need the bottom tab bar there on the rest of the app though.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/15/11 11:40 AM (14 years ago)
This will be tough. Doable, but hacking for sure. The tab bar is designed to 'hide' when a screen is animated in. This is an Apple thing, kinda built in to iOS. However, it doesn't mean you can't do what you want. Try this: Find the UIViewController class file (the .m file) for the home screen you are running. Not sure what type of screen this is? Lets assume it's a custom HTML screen. In this case, it would be BT_screen_customHTML. You get the idea, find the approriate view controller in the BT_Screens folder. Next, in this view controller, hack around in the viewWillAppear method. You'll see some other layout things happening here, like the navigation bar getting setup, etc. So, just before the last closing curly brace in this method is where you'll want to work. What you'll need to do is a) get a reference to the apps 'root' tab bar controller. This will be like: UITabBarController *theTabber = (UITabBarController*)[appDelegate.rootApp rootTabBarController]; Then, if you can do this, experiement with 'setFrame' method of it's view. I'm thinking you could move it off the screen (the frame determines it's position) when the screen shows. Not sure if you'll then need to move it back on when the other tabs are loaded or not? You'll need to experiment with this. SOmething like: UITabBarController *theTabber = (UITabBarController*)[appDelegate.rootApp rootTabBarController]; CGRect myFrame = CGRectMake(0.0, 500, 320, 48); [theTabber.view setFrame:myFrame]; The 500 is the Y value. CGRectMake takes x, y, w, h The next trick will be seeing if this even works - I'll be it does and it will be a matter of moving it on / off the screen as needed. Also, consider device rotation and screen size (ipad) when creating your frame and moving things around.
 
basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
like
12/23/11 10:35 AM (14 years ago)
hi David ok, just spoken with client - he wants the bottom tabs to remain on all pages, including the homage image menu. So, I need to make the buttons rectangular, not square, in order for them to all fit into the available height and have equal spacing all round the buttons. Where would I need to go in order to change the height of the buttons? They always revert to square, and for them to fit in nicely with the bottom tabs, they can't be. I can't use transparency to fake it as the spacing below the buttons would not be equal to the spacing either side of them then. The only way I could do it with transparency is to have the bottom two images shorter than the others and make the rest of the button (that's currently hidden behind the bottom tabs) empty, but he wants all buttons to be the same size. Here's a quick example of where I am - http://b143files.com/argh.jpg I know I could use vertical scrolling to enable all images to be shown fully, but aesthetically that wouldn't be what we're aiming for. Here's a screengrab that fits the height, but needs the buttons to be a little wider to fill the width so the spaces are all equidistant: http://b143files.com/argh2.jpg
 

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.