Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 11    Views: 112

mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
01/10/14 09:21 PM (10 years ago)

BT30 - Day 08 - iPhone 4 and iPhone 5 Backgrounds

BT30 is my personal project to contribute to buzztouch: https://www.buzztouch.com/forum/thread.php?fid=2348BA49BA5737C92E3D9B5&tid=2348BA49BA5737C92E3D9B5 Day 08 - How to make your app use different backgrounds for i4/i5 ** Sorry this took longer then usual, lots to deal with today! --------------- DESCRIPTION --------------- This one should be especially useful. Let's say you have a button menu plugin, and the client wants a logo under the buttons, so you put the logo on the background image and have the buttons above it, awesome! But now you view it on the iPhone 4 and the logo is cut off, if you move the logo up and then view it on iPhone 5 it will be too high. The solution: detect what phone the user is using and use different backgrounds (like you do for the ipad). Now, my situation was above, but you could have many other reasons for wanting to use different backgrounds for i4/i5, and also, this works for ANY plugin using background image. ANY! --------------- INSTRUCTIONS --------------- NOTE: I compiled these instructions from various buzztouch forums posts a long time ago, wish I knew who to thank but I remember it was many people working together, I simply made a guide and simplified it a little. DOWNLOAD FILES: http://buzztouchmods.com/downloads/i4i5.zip ------------- STEP 1 ------------- drag UIImage+H568.h and .m into bt_config folder in your project ------------- STEP 2 ------------- Add a (#import "UIImage+H568.h") without the parentheses to both your appname_appDelegate.h and appname_appDelegate.m --------------------------------------------------------- STEP 3: ADD YOUR BACKGROUND IMAGES (NAMED SPECIFICALLY) --------------------------------------------------------- add images to bt_images named like this: background.png -for iPhone non-retina [email protected] -for iPhone retina like 4S [email protected] -for iPhone 5 ---------------------- STEP 4: Control Panel ---------------------- Go to your control panel -- set background.png as your small device background image and set scale/position to "Full Screen/Preserve Ratio". Make sure to do the scale! and make sure to use only the image name without the @'s and special characters, the app will detect them without your help when the proper device is launched. ---------------------- YOUR DONE! WOO HOO!! ---------------------- Hope this helps someone. Please ask questions if needed. Cheers, David.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/11/14 12:02 AM (10 years ago)
Good share, my good man. From your instructions, seems like magic. How does the App Delegate code know to invoke the new code that is in the files that were just dropped into the BT_config group folder?! Gonna have to dig into it to break that spell. Thank you! -- Niraj
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
01/11/14 01:19 AM (10 years ago)
Thanks!! My codebox is loving you. I made a section just for you :)
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
01/11/14 02:23 AM (10 years ago)
Yep, I use those files in all of my apps..I was completely lost on the whole iPhone 5 screen size issue until i came across them. Great share! Also, just a random but unimportant note...I've found that setting the scale to "Full Screen/Preserve Ratio" makes no difference, but maybe that's just me PS - 30 days of Buzztouch is an awesome idea. Just another one of the amazing things about Buzztouch...it's pretty rare to see such generosity on an internet forum
 
Uelsimon
Lost but trying
Profile
Posts: 272
Reg: Mar 25, 2012
NYC
4,470
like
01/11/14 08:43 AM (10 years ago)
Hmm @Absentia…you raise a good point. I think everyone should join in and share the 1-2 tidbits learned along the way that can help the community. (and…. this should be come at least an annual event.) I wonder what I have that I can contribute… Thanks again MVB
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
01/11/14 09:20 AM (10 years ago)
Ver nice! LA
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
01/30/14 03:38 PM (10 years ago)
@Absentia You've helped me out a ton, cheers mate. Thanks all.
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
03/19/14 07:03 PM (10 years ago)
Does anyone know where I can download the i4i5.zip file? The link in this post is broken.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
03/19/14 08:53 PM (10 years ago)
The new URL is http://btmods.com/downloads/i4i5.zip As David said, it will auto-detect the iPhone 4 or iPhone 5 to display the correct height backgrounds. -- Niraj
 
fusionsch
I hate code!
Profile
Posts: 516
Reg: Dec 28, 2010
Montreux Switze...
11,610
like
03/21/14 05:00 AM (10 years ago)
Thanks a lot, this will be quite useful!
 
Moto110
Aspiring developer
Profile
Posts: 205
Reg: Jul 26, 2011
Orlando, FL
8,700
like
03/21/14 05:10 AM (10 years ago)
This does NOT seem to work on Splash Screen images. Can anyone confirm if this does or does not work with Splash Screen images before I start trouble shooting? Thanks!
 
DougJoseph
Aspiring developer
Profile
Posts: 161
Reg: Jan 30, 2016
Stonewood
2,210
like
02/04/16 02:47 AM (8 years ago)
The download links are all broken now. I am struggling to get at the "white loading screen" issue in a way that accounts for various device screen sizes. Would these files still be helpful? Anyone have a new download link?
 

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.