FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
02/05/15 08:23 AM (9 years ago)

Weird space at bottom of ipad version,

hi guys, can anyone explain to me why on the ipad version of my app, theres a gap between the bottom and the horizontal placed buttons, it only happens on the ipad version, fine on android phones and tablets, also the iphone version is fine as well,i can adjust the height of the buttons in the code if i use grid format, but theres no adjustment i can see for horizontal bottom placed buttons, and even if there was, it would move the buttons to far down for the iphone version, its not a tab bar or anything ive missed cos as ive said, looks great on iphone and all android devices, just weird gap at the bottom of ipad, can anyone point me in the right direction, cheers sean
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
02/05/15 09:15 AM (9 years ago)
Are you are using Susan Metoxen's menu image buttons? Or Menu Buttons by David Book? Are you doing anything to keep the buttons aligned at the bottom?
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/05/15 11:15 AM (9 years ago)
im using the menu buttons, and putting the buttons horizontally bottom, i use the same code for both ios and android, on iphone and android tablet and phones, the buttons line up along the bottom perfect, but on the ipad mini or normal, theres about 1/2 inch gap at bottom, it happens on all my apps when i use this plugin, so theres something somewhere in the xcode settings that effects the large device settings, but i cant find it,
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/06/15 04:01 AM (9 years ago)
heres what its doing, notice how the buttons move up, on the ipad on the left, but behave correctly on the iphone on the right, https://www.dropbox.com/s/pmeyty7khyz6dfl/ios-buttons.png?dl=0
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/06/15 11:18 PM (9 years ago)
Feels like this has the same problem and solution as in Alan's previous post. https://www.buzztouch.com/forum/thread.php?tid=9255D507DE151C6A6C67F2A
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/07/15 03:20 AM (9 years ago)
Same symptom as the HTML "gap" issue talked about yesterday but different. The long version... I opened up the file for this plugin and had a look. If you wanna play you'll be tinkering in BT_screen_menuButtons.m. The details are worked out in a method called "layoutScreen" - this is the method that runs when the screens "builds itself." It starts on line 288. Have a look at this method. You'll see most of it does not run (it's passed over), only some of it does. This is because the layout setting you're using (vertical, horizontal, grid, etc) determines what code in this method runs. So, only some of it runs, depending on the layout. In this case, we're dealing with "horizontalBottom" so we can scroll down to line 436 or so. You'll see where it does "if layout is horizontalBottom"... It's all about setting the FRAME (the size / position) of the scroller that holds the buttons. We need this to be at the bottom of the screen, positioned perfectly. It's not exactly clear what's not right in this situation but it sounds like the "button box" needs to be moved down slightly. It's not nestled nicely at the bottom of the screen like we want - for whatever reason. I'll be it about the same size as the top navigation bar. In other words, the top navigation bar's height is likely about the same as the ugly gap at the bottom. Frames Expalined: You'll see all sorts of places in all sorts of code CGRectMake(0, 0, 0, 0) (where zeros are numbers, or variables). This is saying..."Hey core graphics engine in iOS, make a frame at x, y, width, height. --First Number: x position, left to right, 0 is all the way left --Second Number: y position, top to bottom, 0 is all the way to the top --Third Number: The width of the frame --Fourth Number: The height of the frame In that code you'll see some other conditional checks it makes to try to figure out where the heck the "bottom" of the screen is. Are there tabs to consider? Is device in portrait or landscape mode? Is the top navigation bar showing. etc etc. This is where the rubber hits the road: "myScrollView" is the box that holds all the buttons. So... self.myScrollView.frame = CGRectMake(some x, some y, some width, some height); is what needs adjusted. Height and width are likely fine. Left / Right (x) is likely fine. We're concerned with the Y value. I won't be spending anytime on that plugin anytime real soon. Maybe somebody else wants to tackle it. Dive into the layoutScreens method, see if you can get horizontalBottom to work across all the iOS device types / sizes. If you can, be a hero. Email me the updates and I'll update the plugin.
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/07/15 03:51 AM (9 years ago)
thanks for that david, if any of the gurus has time, i would appreciate any help, something to remember is, it only happens on ipad, and effects both portrait and landscape mode. cheers sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/09/15 03:30 AM (9 years ago)
Morning Guys, David suggested to me, to play around in this area, with the figures and so on, //horiztonalBottom if([buttonLayoutStyle isEqualToString:@"horizontalBottom"]){ contentWidth = (numButtons + 1) * (boxWidth + buttonPadding) + 100; contentHeight = (boxHeight + labelHeight); if(contentWidth < deviceWidth) contentWidth = (contentWidth + 75); //landscape or portrait...tabbed or not... if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){ //portrait mode self.myScrollView.frame = CGRectMake(0, (deviceHeight - boxHeight - boxHeight), deviceWidth, (boxHeight + labelHeight)); if(([[BT_strings getStyleValueForScreen:self.screenData nameOfProperty:@"navBarStyle" defaultValue:@""] isEqualToString:@"transparent"] || [[BT_strings getStyleValueForScreen:self.screenData nameOfProperty:@"navBarStyle" defaultValue:@""] isEqualToString:@"hidden"])){ //adjust depending on device version (iOS 7+ behaves differently) CGFloat deviceVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; if (deviceVersion >=7) self.myScrollView.frame = CGRectMake(0, (deviceHeight - boxHeight - boxHeight + 64), deviceWidth, (boxHeight + labelHeight)); else self.myScrollView.frame = CGRectMake(0, (deviceHeight - boxHeight - boxHeight + 44), deviceWidth, (boxHeight + labelHeight)); } i have tried changing the values on anywhere there was a no, but nothing seamed to work, as for any of the other values, im not code minded so any suggestions, would be much appreciated, Cheers sean
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/10/15 06:23 AM (9 years ago)
what ive noticed is, if you leave the buttons on default in the control panel, the buttons stay on the bottom of the screen in both iphone and ipad, as you increase the size of the buttons, on both iphone and ipad, the buttons move up the screen a bit, with every size increase,
 
FunkyMonkey
Aspiring developer
Profile
Posts: 1177
Reg: Aug 07, 2013
blackpool
14,570
like
02/11/15 06:05 AM (9 years ago)
found a workaround, which kind of stops the buttons from increasing the gap at the bottom as you increase the button size, hope someone can advise to a more permanent solution, ie to keep the buttons on the bottom of the screen, when you increase button size. anyway, i play with these values and it helped a bit. //if we are hiding the tabber we need to add some space at the bottom if([[BT_strings getStyleValueForScreen:[self screenData] nameOfProperty:@"hideBottomTabBarWhenScreenLoads" defaultValue:@"10"] isEqualToString:@"0"]){ self.deviceHeight += 0; }
 

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.