Discussion Forums  >  Uncategorized

Replies: 5    Views: 307

birwin
Lost but trying
Profile
Posts: 93
Reg: Dec 29, 2010
location unknow...
3,080
04/23/11 05:52 PM (14 years ago)

Button Grid List - Last Row Padding - I think I fixed it

Hello, I am getting really close to releasing my 1.5 app! I can't tell you how much I appreciate all the help from Buzztouch and the community. I recently ran into a small issue with a button grid view screen on v1.5 The issue pops up when I have 10 or more buttons in a grid view. These buttons are about 80x80, scaled down from 128x128. The Link Below describes the issue more closely: http://dl.dropbox.com/u/474217/buttongridscroll.jpg The bottom row seems to get cropped out when you release your fingers on the scroll. The grid snaps back in the rest state, making this happen. I seemed to fix the issue by making a small adjustment to Line 432 in BT_screen_menuButtons.m From: if(contentHeight < deviceHeight) contentHeight = (deviceHeight + 50); To: if(contentHeight < deviceHeight) contentHeight = (deviceHeight + 100); This deviceHeight adjustment from 50 to 100 seemed to enable me to scroll all the way down past the last button row, which only has 2 buttons instead of 3. When the fingers are released from scrolling, the bottom row snaps back down with room to spare. I wanted to throw this out there in case anyone else ran into the same issue and/or if there is a better, more appropriate way to apply the fix. Best Regards, HAPPY EASTER!!! :) Brian-
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
04/23/11 10:37 PM (14 years ago)
Whoo-hoo, thanks brian ;-)
 
TOBrien
Lost but trying
Profile
Posts: 29
Reg: Oct 19, 2011
Toms River, NJ
290
like
12/16/11 11:27 AM (14 years ago)
Awesome. Was just looking for this exact thing! Nice fix
 
TOBrien
Lost but trying
Profile
Posts: 29
Reg: Oct 19, 2011
Toms River, NJ
290
like
12/18/11 11:32 AM (14 years ago)
Interesting update... I made this same adjustment and it fixed one of my button menu screens. I have since implemented a new button grid menu with 20 buttons and I'm getting the old behavior where I lose the last row.. even though line 432 in the BT_screen_menuButtons.m file reads : if(contentHeight < deviceHeight) contentHeight = (deviceHeight + 100);
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/19/11 01:06 AM (14 years ago)
It's a matter of 'visualizing' how bit the 'box' is that the buttons scroll in. If you're using a transparent nav bar (usually a bad idea on button screens) it gets a bit tricky. So, the buttons are in a scroll view. This scroll view has a size. UIScrollView setFrame: the size of the scroller. Next, the 'content height / width' inside the scroller is set. The content height controls how long / tall the content is in the box for the UIScroller. If your having trouble with the buttons not showing above the tabs or bottom of screen, or whatever, make the frame (the box) smaller for the UIScrollView on the screen. Can't remember the name of the scroller but something like: [myScrollView setFrame:CGRectMake(0, 0, 320, 300)] would make the scroller 0 from left, 0 from top, 320 wide and 300 tall. CGRectMake it 'core graphics rectangle make' and that call is fundamental to laying out anyting on the screen in iOS. Every object on the screen has a frame.
 
TOBrien
Lost but trying
Profile
Posts: 29
Reg: Oct 19, 2011
Toms River, NJ
290
like
12/21/11 05:43 PM (14 years ago)
That's awesome, David. Thanks a lot for the help. You and the other folks at BT deserve a ton of credit for your relentless dedication of answering all of our questions!
 

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.