piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
09/06/13 12:43 PM (12 years ago)

Button menu - bottom buttons cut off

Hello, I have a button menu setup in my app, which displays fine on android, but in iOS, the bottom buttons are cut off, and you can't scroll down enough to fully see them. I'm using a button grid, with the button size set to 100 and margins set to 40. Everything else is default. does anyone know how to get these buttons to display fully without being cut off? There has to be a small tweak somewhere im missing. thanks!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/07/13 01:28 AM (12 years ago)
Yup...tweak indeed... Have a look at the BT_screen_menuButtons.m file for the plugin. You'll see a UIScrollView that's created to hold all the buttons. This scroller has a frame. The frame is the size of the scroller itself..imagine a "box" around the buttons. Like 316 ish has: [self.myScrollView setFrame:CGRectMake(0, 0, deviceWidth, deviceHeight)]; The CGRectMake function (a built in objective c method) takes four arguments. left, y, width, height. Change the 0's as needed to tweak it around a bit. What you're facing is geometry. If you're using 100, 100 buttons they will be CUTOFF on the bottom of the screen because the number of buttons you're making, with their size, and their margin won't fit on the screen without scrolling. So...maybe it's not the size of the "box" but the size of what scrolls? In other words, if you're OK with them being cutoff, but scrollable so you can see them, you'll want to adjust something else - the content size. Look around line 487, you'll see: self.myScrollView.contentSize = CGSizeMake(contentWidth, contentHeight); The content size is the size of the area that scrolls. Make it taller, it'll work :-)
 
piggilypoo
Aspiring developer
Profile
Posts: 172
Reg: Jun 28, 2011
San Diego
5,120
like
10/01/13 11:05 AM (12 years ago)
Thanks! This worked perfectly :) not used to working in Xcode, still trying to learn how things work lol
 

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.