Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 84

LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
02/02/15 03:20 PM (9 years ago)

iPhone 6 / 6-Plus sizes and menu plugins

Hey there, as I am fed up with the zoomed in view of my apps on an iPhone 6 I decided to get into this. Adding the launch images for iPhone 6 and 6 plus was the easy part, now it does not zoom anymore :-) plugins like the custom url alls look fine now, but having trouble with the menu plugins like Menu Image Rows, Menu Image Advanced, etc.. Menu Buttons works fine by the way and I am pretty sure Kittsy's Mosaic will be fine as well. Menu Image Advanced has code relating iPhone 4 & 5 with the width of 568 for the 5 but nothing in there for the new screen width 375 (iPhone 6) or 414 (iPhone 6-Plus). Can this be updated or does anyone have an idea? Regarding the plugin "Menu Image Rows" I changed the code from iPhone 4 &5 to iPhone 5&6 like this: //iPhone6 if([UIScreen mainScreen].bounds.size.height == 667){ if([headerImageSize isEqualToString:@"Small"]){ imageHeight = 52; }else if([headerImageSize isEqualToString:@"Medium"]){ imageHeight = 84; }else{ imageHeight = 150; } imageWidth = 375; tableHeight = 667 -imageHeight; //iPhone5 }else{ if([headerImageSize isEqualToString:@"Small"]){ imageHeight = 52; }else if([headerImageSize isEqualToString:@"Medium"]){ imageHeight = 84; }else{ imageHeight = 150; } imageWidth = 320; tableHeight = 568 -imageHeight; Kind of works only thing is, that there is a gap between top navbar and header image which I can't get sorted out right now. Must be because of the "wrong" header image size, but which size is the right one now? I am sure that Chris and Susan, maybe even David are aware of this and hope this can be updated soon, as the zooming view does not look professional and is not Buzztouch worthy! For all of you wondering about the sizes, here a link to bookmark: http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
02/02/15 03:43 PM (9 years ago)
Menu Image Rows is solved for iPhone 6 now, 6 Plus ongoing. By changing imageHeight = 150; to imageHeight = 176; there is no gap anymore. Looks fine on iPhone 4, 5 and 6 now.
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
02/02/15 04:12 PM (9 years ago)
Menu Image Advanced is solved for Iphone 6 as well now. Changed the following from line 104 onwards: //imageHeight = [[BT_strings getJsonPropertyValue:self.screenData.jsonVars nameOfProperty:@"imageHeight":@"150"] intValue]; imageHeight = 117; imageWidth = 375; if([UIScreen mainScreen].bounds.size.height == 667) { tableHeight = 667 -imageHeight; }else{ imageHeight = 100; imageWidth = 320; tableHeight = 568 -imageHeight; actually just added imageHeight and imageWidth at the bottom. Looking into iPhone 6-Plus later. Looks fine now for iPhone 4, iPhone 5 and iPhone 6
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/03/15 04:51 AM (9 years ago)
Thanks!
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
02/03/15 05:04 AM (9 years ago)
Thanks Leon! Nice post Going into my snippets :)
 
LeonG
Apple Fan
Profile
Posts: 694
Reg: Nov 08, 2011
Hamburg
17,740
like
02/03/15 06:46 AM (9 years ago)
still hope that Susan and Chris will look into this :-)
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
02/04/15 11:07 AM (9 years ago)
Will come in handy, thanks.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/04/15 11:22 AM (9 years ago)
Hard-coding such values will only work for a wee bit longer, perhaps until iOS 9. The combination of Screen Sizes and Device Orientations is almost getting to be unwieldy. It's time to start incorporating Auto Layout techniques into plugins. That's not an easy task via code. I am exploring such techniques for the Cubbyholes plugin, which must account for lots of possibilities. Interface Builder makes it easier, and it requires other techniques (IBInspectable and IBDesignable) that must be used. It also will generate LOTS of user-created errors. Which means much more forum-based support will be needed from the plugin developers. Currently, using the Control Panel to dictate layouts and implementing it in Code has kept the user on safer ground. This is an interesting topic to discuss with David Book ... -- Niraj
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/04/15 11:54 AM (9 years ago)
I'm with @Niraj on this one. Ideally all of the plug-ins would include their own individual .xib file that would help accommodate for some of this. But, as we all know, almost none of the plug-ins have interface builder files for lots of different reasons. I think the best way to engineer the proper fix, the long-term fix, the most reliable fix, is to include an interface builder file (.xib) in the project with the same name as the class file (the plug-in class name). The app owner, the person doing the engineering, the person doing the debugging, we create this file in Xcode and connect it's view outlet to the appropriate class. That's a complicated way to just say "make an interface builder file for this view controller" Doing this would allow all kinds of quick tinkering, testing, debugging on different device sizes and such. Creating outlets for header images, table views, etc. I know some of the plug-ins "require" certain size header images while others allow the app owner to set this in the control panel. These principles would still make sense and the code could still manipulate the sizes of the views (table view and the image header) as necessary. As with anything, there are lots of ways to try to solve these problems and @Leon's done good job here sleuthing out some of the details. It might be as easy as making an interface builder file, wiring it up to the appropriate outlets created in the.h and .m and running.
 

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.